How to delete files from tempdirectory?

  •  06-04-2010, 4:06 PM

    How to delete files from tempdirectory?

    New to AjaxUploader. 
     
    I was able to do args.MoveTo in C# and that got rid of the file I uploaded in the tempdirectory and saved it permanently somewhere else. But that isn't what I need in the long term.
     
    How do I clear out the temp directory, or better yet, how do I delete a file from the tempdirectory once I've uploaded it, used it, resized it, and saved it in a permanent place?  My tempdirectory just keeps growing.  I'd like to be able to delete the uploaded temp file from my code once I'm done w/ it.
     
    I tried args.delete in FileUploaded and args[0].delete in UploadCompleted but both times got error that file was being used by another process.  I'm assuming it's my own process isn't ready to release it and therefore this is not the way to physically delete the file I just uploaded??  Should I be using the Dispose event?
    THANKS.
    Debbie
View Complete Thread