This is a migrated thread and some comments may be shown as answers.

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

9 Answers 211 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Neel
Top achievements
Rank 1
Neel asked on 10 Mar 2011, 10:25 PM
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.

9 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 11 Mar 2011, 02:30 PM
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?
0
Neel
Top achievements
Rank 1
answered on 11 Mar 2011, 09:07 PM
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
0
Cori
Top achievements
Rank 2
answered on 14 Mar 2011, 01:04 PM
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.
0
Neel
Top achievements
Rank 1
answered on 15 Mar 2011, 04:26 PM
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.
0
Neel
Top achievements
Rank 1
answered on 15 Mar 2011, 04:29 PM
and also, Which one would you prefer for the sake of better performance and convenience -

saving in temporary folder or
saving into database ?

Thanks.
0
Genady Sergeev
Telerik team
answered on 16 Mar 2011, 10:25 AM
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!
0
Neel
Top achievements
Rank 1
answered on 16 Mar 2011, 04:56 PM
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?
0
Genady Sergeev
Telerik team
answered on 18 Mar 2011, 10:52 AM
Hello Neel,

My bad, here is the link.

Regards,
Genady Sergeev
the Telerik team
0
Lola
Top achievements
Rank 1
answered on 20 Jun 2011, 02:05 PM
I can write great opinion essay based on this information!
Tags
Upload (Obsolete)
Asked by
Neel
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Neel
Top achievements
Rank 1
Genady Sergeev
Telerik team
Lola
Top achievements
Rank 1
Share this question
or