<%@ Language=VBScript %> <%Server.ScriptTimeout =12000%> File Uploader <% 'Response.end '--- Declarations dim oUploadedFile dim catid, title, SQL, rsFind, subup, subcat dim image1 if request.querystring("pic")>"" then picid=request.querystring("pic") set getphoto=objConn.execute("select * from designs where designid=" & picid) if not getphoto.eof then photoname=getphoto("designImage") end if end if Dim oFileUp '--- Instantiate the FileUp object Set oFileUp = Server.CreateObject("SoftArtisans.FileUp") '--- Set the Path property to the location you wish to '--- Save the first file '--- Check to be sure there was a file selected in the form '--- If so, continue processing if oFileUp.Form("myFile1")>"" then If Not oFileUp.Form("myFile1").IsEmpty Then desc=oFileUp.Form("photoDesc") oFileUp.Path = Server.MapPath("/newDesigns/") Set oUploadedFile = oFileUp.Form("myFile1") oFileUp.Form("myFile1").Save '--- The file is saved, display a confirmation message Response.Write("File saved successfully on the server as: ") '--- The ServerName() property is the full path of the file '--- where it was saved on the server Response.Write(oFileUp.Form("myFile1").ServerName & "
") image1=oUploadedFile.ShortFileName objConn.execute("insert into designs (designImage, designDesc) values ('" & image1 & "','" & desc & "')") Else Response.Write("Error: There was no file submitted for upload in the first field.
") End If end if if oFileUp.Form("myFile2")>"" then If Not oFileUp.Form("myFile2").IsEmpty Then oFileUp.Path = Server.MapPath("/newDesigns/") Set oUploadedFile = oFileUp.Form("myFile2") oFileUp.Form("myFile2").Save 'oFileUp.form("myFile2").SaveAs (photoname) '--- The file is saved, display a confirmation message Response.Write("File saved successfully on the server as: ") '--- The ServerName() property is the full path of the file '--- where it was saved on the server Response.Write(oFileUp.Form("myFile2").ServerName & "
") Else Response.Write("Error: There was no file submitted for upload in the first field.
") End If end if '--- Destroy objects Set oFileUp = Nothing set objConn=nothing %>