我有一个将照片保存到图像文件夹的网络项目(我使用FileUpload),它可以在客户端运行,但是当我在主机上上传网站后,它不再起作用了,这是我的代码
FileUpload1.SaveAs(Server.MapPath("~/Image/") + FileUpload1.FileName.ToString());
Its probably write permission issues for your Image folder
,Got to your server C-Panel and give necessary permissions to the folder required.
For more on permissions see this http://technet.microsoft.com/en-us/library/bb727008.aspx
Without knowing the exception, the most likely problems are
image
subfolder image
subfolder even exist? 请检查您是否应授予Image文件夹的写权限。
check below code :
FileUpload1.SaveAs(Server.MapPath(@"Image/") + FileUpload1.FileName.ToString());
i think this will work. Please let me know.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.