You should check for a local file first and either delete the local file before you upload the new file or rename the incoming file so it doesn't interfere with the existing file..
Main Topics
Browse All TopicsHiya,
In my web, there's an option to upload images to the server. If I want to just upload a file that doesn't exists, it works fine, I can do it. But if I try to upload a file with the same name as one that already exist in the server, I get the error:
Access to the path ... is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
Now, if I go to IIS and browse to this particular folder (under "Web Sites->Library->Images"), right click on properties and I have checked "Read" and "Write" options.
If I go to the Explorer and right clicki on those images none of them have the "Read-only" property set.
It seems like I should have access to overwrite those images. And since I can upload images that do not exist already in the server, I imagine I have access to that as well.
Can anyone provide some help her eplease?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks for the responses guys.
@Chirag1211: I don't think that't the problem, since I *can* write files in the folder. But if it is that, how would I grand the ASPNet user that permission?
@rlh68: That could be it.. But is there no way of just overwriting the file? I was looking at the FileUpload specs in microsofts page and it seems to overwrite previous files in the server.
Business Accounts
Answer for Membership
by: Chirag1211Posted on 2008-08-27 at 09:29:24ID: 22326663
See the error that you are getting is because in the Images folder of your application you need to grant write permission to ASPNet user then it won't throw any error for this.
Regards,
Chirag