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

Big picture question about the operation of the RadAsyncUpload control

1 Answer 24 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 17 Oct 2014, 02:13 PM

Excuse me if this post somewhat overlaps others I've made recently but I've been reviewing your docs and demos concerning RadAsyncUpload and I am getting more confused by the second.

What I need is the following scenario.
   1.  A single file is selected with the RadAsyncUpload control.  (Usual display of file name with remove option)
   2.  The page goes through several postbacks involving failed validation of other controls while the RadAsyncUpload control retains its display of file name and the option to remove.  (It appears that currently this process wipes the display of the RadAsyncUpload control.  This was not a problem as long as all validation was client-side.  Is there anyway to retain or restore the visible settings of the RadAsyncUpload control, or do I have to write my own code to keep track of the uploaded file?)
   3.  Once the final postback process occurs the uploaded file is streamed into a database field using an Uploaded File object.  (UploadedFile file = RadUpload1.UploadedFiles[0]; file.InputStream.Read etc...)                    

I recently replaced the old RadUpload controls with RadAsyncUpload controls so I recognize that I may have plugged them into a scenario that no longer works.
  (Furthermore I'd like to say that the behavior of the RadAsyncUpload control with regard to the TargetFolder confuses me as well.  What happens if two people upload files with identical names at the same time?)

1 Answer, 1 is accepted

Sort by
0
Boris
Top achievements
Rank 1
answered on 20 Oct 2014, 02:28 PM
If you can't solve the problem, change the problem. 

My problem was that I had plugged in a RadAsyncUpload control into the place of a RadUpload control without fully understanding the true nature of RadAsyncUpload.  I suspect that I still do not fully understand RadAsyncUpload's behavior.

But, for my purposes it doesn't matter.  

The problem was that upload's settings were getting wiped by server-side validation postbacks.  

The solution was to place the RadAsyncUpload control outside the RadAjaxPanel in which all the other controls were located  (Validators, submit button, etc).  This appears to solve all my problems.  

(In fact, given that this form needs to control whether or not a file is uploaded, the custom validator monitoring the RadAsyncUpload can be left within the RadAjaxPanel.  This works fine as well.)
Tags
AsyncUpload
Asked by
Boris
Top achievements
Rank 1
Answers by
Boris
Top achievements
Rank 1
Share this question
or