Can't delete file after upload.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there

I am having trouble deleting an uploaded file that I have just written to
disc. I am using the SaveAs method of a HttpPostedFile to write the file to
disc, then straight after I'm trying to use kill(FILE) to delete it. I
get the error "The process cannot access the file "FILE.JPG" because it is
being used by another process."
If I use the Explorer-program to try and delete the file afterwards I get
the error "Cannot delete FILE.JPG: There has been a sharing violation. The
source or destination file may be in use"

Does anyone have a solution?

Best regards

Michael K.
 
Well Michael i have exactly the same kind of application and mine works just
fine..
Try posting ur code..
Patrick
 
Hi Patrick

I have found the error. After upload I do some resizing of the uploaded
picture and it was this function which locked the file. :-/

Sorry for your interuption.

Best regards
Michael K
 
Back
Top