RadUpload loses the uploaded file on any button clicked(on post back)

Thread is closed for posting
10 posts, 0 answers
  1. Neel
    Neel avatar
    17 posts
    Member since:
    Sep 2010

    Posted 10 Mar 2011 Link to this post

    Hi,

    I have a RadUpload control, after selecting a file if i press any button or radio button(ie if i postback), the webpage automatically clears the inputbox of RadUpload removing any file uploaded with the control. Please suggest me any solutions to it. Am i missing any property here?

    thanks.
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 11 Mar 2011 Link to this post

    Hello Neel,

    What does you page markup look like? Are you somehow clearing the RadUpload using it's client-sde api, to prevent it from uploading the file when another control posts back?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Neel
    Neel avatar
    17 posts
    Member since:
    Sep 2010

    Posted 11 Mar 2011 Link to this post

    Hello,

    Thanks for getting back to me.
    No I neither clear RadUpload explicitly nor call any Client side API for that.

    Here is some more information about the web page.This explanation should clear the idea.

    The page has information about a poll question.
    I have a text box to enter Question. 
    one text box through which i add answers and create check box list out of those answers entered, I also have remove button to remove one or more of the answers.
    Then I have this rad upload to upload a picture for the poll.
    then i have an option to comment with the help of a radio button list.
    Then I have save and cancel buttons to save this question info or cancel the operation.

    Now lets say I added a question, then added 3 answers to it and created the check box list. Then after uploading a picture if I change the radio button selection or press any button to remove any answers from the answer list. It calls a post back clearing everything on the page. Now I store all this info about question answer list in session from which i can get it back to reset these values after post back but now how do i save this RadUpload info in session to retrieve it back after post back?
    Is there any way to save this info in session, I don't want to save the entire image in session and if its the only way then please explain me how to save this image in session.
    Thanks
  5. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 14 Mar 2011 Link to this post

    Hello Neel,

    That situation makes sense, since your page postback is caused by another control, other than the Save button, so it's always uploading the file when those other controls postback. The only way to hold the image that was uploaded is to save it to a temp folder and store the filename in session, so you can retrieve it later when the Save button is pressed.

    I hope that helps.
  6. Neel
    Neel avatar
    17 posts
    Member since:
    Sep 2010

    Posted 15 Mar 2011 Link to this post

    Hey,

    Thanks. That helped. Do you have any sample example of what you are saying about saving file to temporary folder and then retrieve it for further saving.

    If yes please can you reply with that link or code files?

    Thanks once again for your help.
  7. Neel
    Neel avatar
    17 posts
    Member since:
    Sep 2010

    Posted 15 Mar 2011 Link to this post

    and also, Which one would you prefer for the sake of better performance and convenience -

    saving in temporary folder or
    saving into database ?

    Thanks.
  8. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 16 Mar 2011 Link to this post

    Hello Neel,

    The following demo demonstrates how to save a file to a folder (temporary or target). You need to save its location to a session object, which could be retrieved then and used on demand.

    All the best,
    Genady Sergeev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  9. Neel
    Neel avatar
    17 posts
    Member since:
    Sep 2010

    Posted 16 Mar 2011 Link to this post

    Hey Did you forget to give any files or link with this reply, Where should I find that Demo? am I missing something over here?
  10. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 18 Mar 2011 Link to this post

    Hello Neel,

    My bad, here is the link.

    Regards,
    Genady Sergeev
    the Telerik team
  11. Lola
    Lola avatar
    1 posts
    Member since:
    Jun 2011

    Posted 20 Jun 2011 Link to this post

    I can write great opinion essay based on this information!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017