How to delete files from tempdirectory?

Last post 06-15-2010, 9:50 AM by debdba. 5 replies.
Sort Posts: Previous Next
  •  06-04-2010, 4:06 PM 61581

    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
  •  06-04-2010, 6:00 PM 61589 in reply to 61581

    Re: How to delete files from tempdirectory?

    Debbie,

    Ajax Uploader automatically maintain this temp folder.  All temp files will be deleted. 
     
    We compare the current time with the File.GetLastWriteTime.  Regular temp files will be deleted 5 minutes later. Persisted temp files will be deleted 360 minutes later.
     
    After 360 minutes if some one uses the uploader, uploader will delete the expired files. If nobody uses the uploader,  the expired files will stay there.
     
    If you have concerns abouy temp files, you can write some code and delete the temp files yourself.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-11-2010, 8:56 AM 61691 in reply to 61589

    Re: How to delete files from tempdirectory?

    Thanks so much.  I tested this and it's perfectly true!!  My uploaded temp files are all the persisted files so they hang around for 6 hrs.  How do I take that off so they will purge quicker?
    Debbie
  •  06-11-2010, 1:06 PM 61695 in reply to 61691

    Re: How to delete files from tempdirectory?

    Is there a way to make the temp files uploaded regular temp files instead of persisted temp files?
    THANKS
  •  06-14-2010, 3:10 PM 61734 in reply to 61691

    Re: How to delete files from tempdirectory?

    In Ajax Uploader, code is encapsulated and you cannot update the 6 hr time interval parameter.
     
    Regards,
    Eric
  •  06-15-2010, 9:50 AM 61752 in reply to 61734

    Re: How to delete files from tempdirectory?

    THANKS VERY MUCH  !!
View as RSS news feed in XML