文件上传在本地但在服务器上工作正常,显示访问被拒绝 [英] file upload working fine on local but not on server, showing access denied
问题描述
拒绝访问路径'D:\INETPUB \VHOSTS \24hrslivesupport.com \ httpdocs \ Uploadfile \ Winter.jpg'。
第109行:Label1.Text = filename.ToString();
第110行:
第111行:Fileproject.SaveAs(服务器.MapPath(〜/ Uploadfile /+ filename));
第112行:// string filename1 = Path.GetFileName(FileUpload1.FileName);
第113行: lblmag.Text =上传状态:文件已上传!;
源文件:d:\inetpub \vhosts \24hrslivesupport.com \ httpdocs \ ProductControlPanel.aspx.cs行:111
Access to the path 'D:\INETPUB\VHOSTS\24hrslivesupport.com\httpdocs\Uploadfile\Winter.jpg' is denied.
Line 109: Label1.Text = filename.ToString();
Line 110:
Line 111: Fileproject.SaveAs(Server.MapPath("~/Uploadfile/" + filename));
Line 112: // string filename1 = Path.GetFileName(FileUpload1.FileName);
Line 113: lblmag.Text = "Upload status: File uploaded!";
Source File: d:\inetpub\vhosts\24hrslivesupport.com\httpdocs\ProductControlPanel.aspx.cs Line: 111
推荐答案
您的应用程序正在以对该文件夹D:\\的写访问权限的用户身份运行\\ INETPUB \VHOSTS \24hrslivesupport.com \httpdocs \ Uploadfile \
。
编辑该文件夹的NTFS权限给予必要的烫发发给用户。
Your application is running as a user which does not have write access to the folderD:\INETPUB\VHOSTS\24hrslivesupport.com\httpdocs\Uploadfile\
.
Edit the NTFS permissions on that folder to grant the necessary permissions to the user.
这篇关于文件上传在本地但在服务器上工作正常,显示访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!