I make a web application and I use a File Upload server control
. When I save the files to a specific folder, I get Access denied
to this path all the time also I give Full control
permission for Every One
. I work in dev mode
. I want a solution for both the dev mode
and the production environment.
The exception appears in the following line::
fu.SaveAs(Server.MapPath("~//xml"));
StackTrace:
StackTrace " at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)\r\n at System.IO.FileStream..ctor(String path, FileMode mode)\r\n at System.Web.HttpPostedFile.SaveAs(String filename)\r\n at System.Web.UI.WebControls.FileUpload.SaveAs(String filename)\r\n at Schedule.ScheduleForm.btn_Search_Click(Object sender, ImageClickEventArgs e)
Is the SaveAs()
method the problem reason, or there is some thing wrong in the path? Because I tried everything, I gave full control permissions to many users, but in vain.