the process cannot access the file because it is being used by another process

B

bala

Hi All,

I have a popup for image upload with a upload button,save button and one close button
I am uploading images with a file control after browsing when I click on upload button it
upload the file to some folder /xyz/temp/ folder with name 101.jpg
now i close the popup.
now when i again open and try to upload (upload the file to same folder /xyz/temp/ folder with name 101.jpg)
it gives me exception on this line
inputFile.SaveAs(MapPath(/tmp+"//"+fileName));
saying
"the process cannot access the file (101.jpg)because it is being used by another process"
this exception is thrown.
now if i restart the asp.net worker process this exception doesnt comes
that mean the file is cached in memory by the asp.net worker process.

Thanks in advance
bala
 
B

Brock Allen

This error means that you have some code somewhere that's not closing the
file.
 
B

bala

this is one of the reason but I had varified that no file is left open! its
something else that I am not able to find out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top