Jag undrar hur jag kan ändra det här scriptet så det skapar en mapp med samma namn som username "variblen"
Sen ska ju upload pathen ändras till det också så att filen laddas upp i en mapp med användarens namn.
'<%
' Variables
' *********
Dim mySmartUpload
Dim intCount
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("/Katalog/Images")
' sample with a physical path
' intCount = mySmartUpload.Save("c:\temp\")
%>
<%
'Declare all local variables
dim conn
dim rs
dim strID
dim strconn
'set a local variable to my DSN-less connection String
strconn = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\data\WebData\katalog.mdb;"
'Create the Connection object
set conn = server.createobject("adodb.connection")
conn.open strconn
'Create the recordset object
set rs = server.createobject("adodb.recordset")
'This statement opens the table so we can add a record notice the addnew
'The 2, 2 is how the table is opened there are many ways it can be opened
rs.open "Kat", conn, 2, 2
'Use the addnew method of the recordset object to add a record
rs.addnew
'Set the table column = to my input text box from my form
rs("Namn") = mySmartUpload.Form("Namn")
rs("Naradress") = mySmartUpload.Form("Naradress")
rs("Postnr") = mySmartUpload.Form("Postnr")
rs("Ort") = mySmartUpload.Form("Ort")
rs("Tel") = mySmartUpload.Form("Tel")
rs("Fax") = mySmartUpload.Form("Fax")
rs("Epost") = mySmartUpload.Form("Epost")
rs("www") = mySmartUpload.Form("www")
rs("Amnesomrade") = mySmartUpload.Form("Amnesomrade")
rs("Ovrigt_swe") = mySmartUpload.Form("Ovrigt_swe")
rs("Ovrigt_fin") = mySmartUpload.Form("Ovrigt_fin")
rs("Username") = mySmartUpload.Form("Username")
rs("Password") = mySmartUpload.Form("Password")
rs("Filename") = mySmartUpload.Form("Filename")
rs.update
'I do a movelast here to get the ID that is automatically generated
'I also set the value to a local variable so I can write out to the database
rs.movelast
strID = rs("ID")
%>
------------------
His Divine Shadow is the most despicable being ever created, short and to the point.
dim mappnamn
mappnamn = request.form("mappnamn")
Set Skapa = Server.CreateObject("Scripting.FileSystemObject")
Set Mapp = Skapa.CreateFolder(Server.MapPath(mappnamn))
------------------
Real mad hiphop flavaz kickin' it right from tha street without no FEAR, Yo !
<%
' Variables
' *********
Dim mySmartUpload
Dim intCount
dim skapamapp
username = request.form("username")
Set Skapa = Server.CreateObject("Scripting.FileSystemObject")
Set Mapp = Skapa.CreateFolder(Server.MapPath(katalog/images/skapamapp))
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("/Katalog/Images/skapamapp")
' sample with a physical path
' intCount = mySmartUpload.Save("c:\temp\")
%>
------------------
His Divine Shadow is the most despicable being ever created, short and to the point.
OK har det såhär nu men fortfarande samma overflow fel.
dim skapamapp
skapamapp = request.form("username")
Set Skapa = Server.CreateObject("Scripting.FileSystemObject")
Set Mapp = Skapa.CreateFolder(Server.MapPath(katalog/images/skapamapp))
------------------
His Divine Shadow is the most despicable being ever created, short and to the point.