Hi friends,
My question is...
I was Created asp.net application using asp 2005 and code behind file as the C#.net with IIS 6
Then I host my web application on internet in IIS 6 server...
There is the page,using this i can upload file[image files] to internet...[by using file uploader] when i upload some file to my remote machine there is the exception occur like that
System.UnauthorizedAccessException: Access to the path 'D:\inetpub\vhosts\foxads.lk\httpdocs\foX\mainImage\314.jpg' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 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) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at System.Web.UI.WebControls.FileUpload.SaveAs(String filename) at createAd1.addMainImage(Int32 AdId)
Wht am i doo please help me...:D
my c# source code is...
mainImage.SaveAs(Server .MapPath ("~/mainImage/myImage.jpg"));
thanks.......