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

RadUpload Remove Selected Files in Code Behind

1 Answer 273 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Adam Dilger
Top achievements
Rank 1
Adam Dilger asked on 18 Feb 2010, 10:31 PM
I have a radupload control that I want to act as a simple file upload (much like the old asp file upload worked), so am using it like this:

<telerik:RadUpload ID="RadUploadEmployeePhoto" runat="server"   
         ControlObjectsVisibility="None" InitialFileInputsCount="1"   
         MaxFileInputsCount="1" /> 

I need to be able to iterate through the collection of selected files in my code behind (I'm using VB) and remove all selected files.

To give some background on why I need to do this, I am working on a corporate directory application.  When an Admin is editing an employee record, they are presented with 3 checkboxes (Add Photo / Delete Photo / Restore Backup).  I have my code set up to only allow one checkbox to be selected at a time (much like the functionality of a radio button) and the radupload is only visible when the "Add Photo" checkbox is selected (otherwise, I set visible=false).  Now, should the user select "Add Photo" and then select a photo to upload, and then change their mind and select "Restore Backup", the radupload control will not be visible, but will still have a selected value, and the upload will still be processed as normal, but will conflict with the "Restore Backup" option the user selected last.  To solve the issue, in my code behind, I need to be able to remove all selected files.

Thanks!

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 23 Feb 2010, 01:51 PM
Hello Adam,

I'm copying the response to your ticket here for reference:

Indeed, support tickets are treated with higher priority. Regarding the issue, I suggest that you clear the selected file on the client. This will mean faster form submission and no additional code on the server.

Please, see this help article:

http://www.telerik.com/help/aspnet/upload/client-side%20api%20reference%20-%20classes%20-%20radupload%20-%20methods%20-%20clearfileinputat.html

I hope this helps.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Upload (Obsolete)
Asked by
Adam Dilger
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or