c# - AWS, page is unable to save to file system -


i'm using following code save server. page uploding image folder. works fine on local host. when upload project amazon web services using elastic beanstalk, gives error.

 string filename = fileupload1.filename;  fileupload1.saveas(server.mappath("~/paperwork/" + lblcompid.text + "-" + listbox1.selectedvalue + "-paperworkfile_1_.png")); 

server error in '/' application.

access path 'c:\inetpub\wwwroot\paperwork\20045-11022-paperworkfile_1_.png' denied.

description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code.

exception details: system.unauthorizedaccessexception: access path 'c:\inetpub\wwwroot\paperwork\20045-11022-paperworkfile_1_.png' denied.

asp.net not authorized access requested resource. consider granting access rights resource asp.net request identity. asp.net has base process identity (typically {machine}\aspnet on iis 5 or network service on iis 6 , iis 7, , configured application pool identity on iis 7.5) used if application not impersonating. if application impersonating via , identity anonymous user (typically iusr_machinename) or authenticated request user.

to grant asp.net access file, right-click file in file explorer, choose "properties" , select security tab. click "add" add appropriate user or group. highlight asp.net account, , check boxes desired access.

i know need permissions, have no idea what. please help.

resolved. had remote virtual server. used command line change permissions folder.

icacls "c:\work" /grant everyone:(oi)(ci)f


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -