我試圖從瀏覽器上傳文件並將其複製到URL文件夾如何上傳文件到url
使用c sharp。
(我擁有所有權限到這個文件夾)
我沒有problam文件上傳到我的硬盤驅動器
這樣的:
HttpPostedFileBase myfile;
var path = Path.Combine(Server.MapPath("~/txt"), fileName);
myfile.SaveAs(path);
我已經嘗試將其上傳到這樣的網址,但我得到一個例外
HttpPostedFileBase myfile;
var path =VirtualPathUtility.ToAbsolute("http://localhost:8080/game/images/"+fileName);
myfile.SaveAs(path);
例外:
System.ArgumentException: The relative virtual path 'http:/localhost:8080/game/images/ a baby bottle. Jpg' is not allowed here.
In - System.Web.VirtualPath.Create (String virtualPath, VirtualPathOptions
能否請您發佈文本從例外情況來看,我們其他人也可以從中學習? – kush 2013-03-11 13:31:43