c# - Access to the path '...\email@gmail.coml.jpg' is denied -


i have hosted aspx website contains registration page. when trying upload image showing following error:

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 'd:\inetpub\vhosts\example.org\httpdocs\alumni\uploadimage\email@gmail.coml.jpg' 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 have given full read, write, modify permission folder. below coding have used.

fileupload1.postedfile.saveas(server.mappath(".") + "//uploadimage//" + str); string path = "../alumni/uploadimage/" + str.tostring(); 


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -