Is it possible to NOT processes uploaded files?

3 posts, 0 answers
  1. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 25 Mar 2011 Link to this post

    I'm looking for a way to prevent the automatic processing of uploaded files (moving them from the temp folder to the target folder, along with some custom processing that I put in the OnFileUploaded event) if the user doesn't explicitly ask for the files to be processed.

    More detail on the scenario:  The async uploader is on a page with multiple tabs.  When the user wants to upload files, they click on a tab where the async uploader exists.  The tabs are configured to do a postback.  I think that if they were to select some files, then change their mind and move on to another tab (causing a postback), that the files shouldn't be processed.  However, I can't see a way to prevent that from happening.  I want to put a button there that lets the user "accept" the files and start processing them.

    I'm looking for a supported, documented means to only process the files if explicitly fired off (via a button onclick handler, for example), and delete the temporary files on postback if the processing isn't requested.  Is this possible/available?

  2. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 31 Mar 2011 Link to this post

    FWIW, I have a solution to this, but I was looking for something more directly supported.

    Essentially, I look to Request.Form("__EVENTTARGET") to determine what triggered the postback.  (This requires that my button have UseSubmitBehavior="false").  If the button was the cause of the postback, I trigger the processing of the file.  If it was not, I set e.isValid to false so that the file is not processed.
  3. Genady Sergeev
    Genady Sergeev avatar
    1600 posts

    Posted 01 Apr 2011 Link to this post

    Hello LeBear,

    Thank you for pointing this issue, indeed RadAsyncUpload will process the files on a postback, no matter whether it is from the submit button or from other control. Unfortunately, a workaround is not supported out of the box. However, the one that you have found is fine one. We will brainstorm on how to handle such scenarios and probably implement an out of the box workaround for service pack 2. Until then, I suggest that you stick to your current approach.

    Genady Sergeev
    the Telerik team
Back to Top