If I assign the TempDirectory dynamically, the ajaxupload control creates the directory if it is not there. I need to disable that

Last post 06-11-2009, 7:54 AM by pi2. 2 replies.
Sort Posts: Previous Next
  •  06-10-2009, 4:06 PM 52973

    If I assign the TempDirectory dynamically, the ajaxupload control creates the directory if it is not there. I need to disable that

    I would rather make the directory on the fly if a person decides to upload files.  Is there a way to disable the ajaxupload feature that creates the directory if it is not present?
     
    What I'm trying to do is assign the tempdirectory when the page loads.  If the user decides to upload files to the tempdirectory, I want to be the one to create the directory and then put those files there (using the ajaxuploader).  I don't want to end up with a huge amount of empty directories.
  •  06-11-2009, 2:01 AM 52984 in reply to 52973

    Re: If I assign the TempDirectory dynamically, the ajaxupload control creates the directory if it is not there. I need to disable that

    Hi,
     
    You can implement the custom uploader provider to save the temporary files.
     
    1 - create a class which inherits the CuteWebUI.UploaderProvider
     
    2 - register it into web.config appSettings:
      <add key="CuteWebUI.AjaxUploader.Provider" value="YourProject.YourProviderClass" />
     
    And then you can save the file to any place only when it required , without specify the uploader.TempDirectory dynamically.
     
    Regards,
    Terry
  •  06-11-2009, 7:54 AM 52999 in reply to 52984

    Re: If I assign the TempDirectory dynamically, the ajaxupload control creates the directory if it is not there. I need to disable that

    Oh wait, now I see what's going on. 
     
    The temp directory holds the .resx files, while the upload directory can be different.
     
    I had them all going to the same place.
     
    This works out even better.
     
    Thanks.
View as RSS news feed in XML