Can't delete file after upload.

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.
 
G

Guest

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

Guest

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
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top