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?
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?