Home All Groups Group Topic Archive Search About

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

Author
7 Apr 2005 11:10 AM
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

Author
7 Apr 2005 1:32 PM
Brock Allen
This error means that you have some code somewhere that's not closing the
file.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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
Author
8 Apr 2005 10:15 AM
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.


Show quoteHide quote
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:396696632484631226014304@msnews.microsoft.com...
> This error means that you have some code somewhere that's not closing the
> file.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
> > 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
>
>
>