ASP Upload Component - Classic ASP

白昼怎懂夜的黑 提交于 2021-01-27 23:51:41

问题


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

回答1:


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 



回答2:


You already set a folder path to upload not need use like this "server.mappath"

please use below of code.

Set Upload = Server.CreateObject("Persits.Upload" ) 

Upload.SetMaxSize 10000000 ' Maksimum dosya büyüklüğü Byte cinsinden 
Upload.OverwriteFiles = True 

Path = "../../duyurular/"
Count = Upload.SaveAsVirtual(Path) 



回答3:


for godaddy you have to go in and change the server folder permission to read/write. Otherwise you get that error message.




回答4:


well I also get encounter with this problem, I just changed the folder privileges from Go-daddy Hosting server so Any one can read or Write file from specific location

Many Thanks
Ahsan Aziz Abbasi



来源:https://stackoverflow.com/questions/9805661/asp-upload-component-classic-asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!