Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload Multiple Files

Status
Not open for further replies.

DebbieC

Programmer
Mar 29, 2001
168
US
I have a form that has two fields for uploading files but they need to go to 2 seperate directories. "Attachment" should go to the "documents" directory. "ExamFile" should go to the "tests" directory. I've been researching it and found some information about it but I still can't get it to work. Most sites mention that for multiple files you need to do SaveAs instead of Save (which I do anyways) but I still can't get it to work.

This is what I use for one upload:

Set upl = Server.CreateObject("SoftArtisans.FileUp")
upl.Path = "d:\Inetpub\filename = Mid(upl.UserFilename, InstrRev(upl.UserFilename, "\") + 1)
If filename <> "" then
upl.SaveAs filename
Attachment = filename
Else
Attachment = ""
End If

This is what I have tried according to information I have found:

Set upl = Server.CreateObject("SoftArtisans.FileUp")
upl.Path = "d:\Inetpub\upl.Form("Attachment").SaveAs filename
Attachment = filename

upl.Path = "d:\Inetpub\upl.Form("ExamFile").SaveAs filename
ExamFile = filename

With this code I get the message:
Object required: '[undefined]'

Also, I don't know where I would put the "Mid(upl.UserFilename, InstrRev(upl.UserFilename, "\") + 1)" code.

Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top