Search code examples
asp.netwindows-server-2008ajaxcontroltoolkittemp

AjaxFileUpload don't flush %windir%\temp\


I have a considerable issue, found by hosting several ASP.NET websites (7 ~ 15) with the AjaxFileUpload server control of the AjaxControlToolkit library (the latest version):

while the control is processing file, temporary files are saved in the system temporary folder (%windir%\temp), but it won't flush that after the request is complete.

I don't know if this is a folder permission problem, or an AjaxFileUpload bug.

This is the result after 2 years of hosting, a huge stack of temporary folders:

Top enter image description here

Bottom enter image description here

There is any way to override that behavior, or i must manually flush that folder every 1-2 months ?

Thanks in advance


Solution

  • If you don't use SaveAS() method, you must deleted yourself.

    example:

    protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) {
        // Save uploaded file to a database table
    
        e.DeleteTemporaryData();
    }
    

    more info here: http://stephenwalther.com/archive/2013/04/30/april-2013-release-of-the-ajax-control-toolkit