Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP Upload Component - Classic ASP

I have just moved a site from a dedicated server to a GoDaddy shared hosting account, and have just encountered loads of problems! One being with ASP Upload.

In Classic ASP, this is what I would normally do to upload files to my folder:

Set upload = Server.CreateObject("Persits.Upload")
uploadPath = Server.MapPath("../../files/photos/"&token_&"/")
upload.IgnoreNoPost = True
upload.Save(uploadPath)
Set upload = Nothing

But since moving to GoDaddy, I get this nasty message:

This feature has been disabled by the system administrator. Use SaveVirtual instead.

I went on to ASP Upload's website documentation and I could not find SaveVirtual, only SaveAsVirtual which is where I have become unstuck.

I tried using SaveAsVirtual but it threw an error stating that I was using a physical path and I should be using a virtual path! I really don't understand this and was hoping that somebody could put me straight. My website is now deemed broken and is offline, please help.

This is what I tried before the physical/virtual path error:

Set upload = Server.CreateObject("Persits.Upload")
uploadPath = Server.MapPath("../../files/photos/"&token_&"/")
upload.IgnoreNoPost = True
upload.SaveAsVirtual(uploadPath)
Set upload = Nothing
like image 538
TheCarver Avatar asked Dec 06 '25 09:12

TheCarver


1 Answers

According to the docs, the method is named SaveVirtual. It does the Server.MapPath conversion for you.

So, try:

Set upload = Server.CreateObject("Persits.Upload")
uploadPath = "../../files/photos/"&token_&"/"
upload.IgnoreNoPost = True
upload.SaveVirtual(uploadPath)
Set upload = Nothing 
like image 105
D'Arcy Rittich Avatar answered Dec 08 '25 15:12

D'Arcy Rittich