locked
AsyncFileUpload disappears RRS feed

  • Question

  • User946151542 posted

    AsyncFileUpload disappears when near by asp dropdownlist postbacks, both the controls
    are inside update panel

    Monday, March 2, 2015 9:30 PM

Answers

  • User-760709272 posted

    If you wanted that kind of approach I'd at least save the file to disk in a "scratch" folder and keep the name of the saved file in the session.  When the process completes move the file to the proper area\database\wherever.  Then have a clean-up task to delete old files from the scratch folder.  Or process the form first and when it is done give the option of uploading the file as the next step.

    Storing files in the session is a bad idea for your server resources and a malicious person could even use it to bring down your site.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 5, 2015 6:57 AM

All replies

  • User-760709272 posted

    file upload controls don't work inside asynch updatepanels so move it outside of the updatepanel, or have the upload as a separate process after the updatepanel has been processed.  You can't default a file upload to point to a specific file, so it can't maintain state between postbacks the way other controls can.  This is for security reasons.

    Tuesday, March 3, 2015 5:17 AM
  • User1918509225 posted

    Hi anbujeremiah,

    Please remove the AsyncFileUpload out of UpdatePanel, since it does not cause page refresh hence donot put it inside update panel.

    Best Regards,

    Kevin Shen.

    Tuesday, March 3, 2015 9:47 PM
  • User-1506965535 posted

    AsyncFileUpload disappears when near by asp dropdownlist postbacks, both the controls
    are inside update panel

    Hi,

    try below link

    http://www.codeproject.com/Tips/101834/How-to-Maintain-FileUpload-Control-s-State-after-P

    Thursday, March 5, 2015 6:24 AM
  • User-760709272 posted

    anbujeremiah

    AsyncFileUpload disappears when near by asp dropdownlist postbacks, both the controls
    are inside update panel

    Hi,

    try below link

    http://www.codeproject.com/Tips/101834/How-to-Maintain-FileUpload-Control-s-State-after-P

    I wouldn't recommend doing that at all.

    Thursday, March 5, 2015 6:32 AM
  • User-1506965535 posted

    I wouldn't recommend doing that at all.

    Is there any other better way ??

    Thursday, March 5, 2015 6:38 AM
  • User-760709272 posted

    If you wanted that kind of approach I'd at least save the file to disk in a "scratch" folder and keep the name of the saved file in the session.  When the process completes move the file to the proper area\database\wherever.  Then have a clean-up task to delete old files from the scratch folder.  Or process the form first and when it is done give the option of uploading the file as the next step.

    Storing files in the session is a bad idea for your server resources and a malicious person could even use it to bring down your site.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 5, 2015 6:57 AM
  • User-1506965535 posted

    Storing files in the session is a bad idea for your server resources and a malicious person could even use it to bring down your site.

    Agreed with you Sir, :) 

    Thanks a lot.!!!

    Thursday, March 5, 2015 7:06 AM