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

How to delete correct file using a custom handler

4 Answers 103 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Dwayne
Top achievements
Rank 1
Dwayne asked on 16 May 2011, 01:15 PM
I am using q2 2010. I am using the radasyn control to upload files. The Issue I am having is I can't tell which file to delete and remove. Say I have 5 files uploaded and want to remove one, since I uploaded all the files to the DB I need to delete the fiel from the DB as well as the client screen. I can'''t seen to find a way to achieve both options. I can delete from the client screen but can delete from the db becasue I can't tell which file is being deleted. I can only get the index of the file. I have searched for some documentation on the onclientdeleteing eventargs but it is no longer used by the newer version . Do you have any suggestions. I have all the id for the files uploaded and associated with each image as the image id but I can't tell which file is being deleted. Thanks in advance

4 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 19 May 2011, 11:41 AM
Hi Dwayne,

When remove a file, OnClientFileUploadRemoving event is fired. get_fileName() form the event arguments returns the file name.
Another suggestion is to upload files to the DB after the postback.
FileUploaded event occurs server-side for every file which is going to be processed.

Kind regards,
Peter Filipov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Dwayne
Top achievements
Rank 1
answered on 19 May 2011, 01:44 PM
Thanks for the reply. I think I will use that suggestion. What I will do is append the id to the file name and use that as the image id so when I am deleting the file with a delete handler I have created i will know which file to delete. All the  files I am deleting and uploading are on the client using handlers so a post back doesn't occur. and I notice that if a post back happens the image is removed so you don't can't see the pictures anymore.  Thanks again  for the suggestion.
0
David
Top achievements
Rank 1
answered on 30 Mar 2012, 02:32 AM
I have a similar issue. I would just like to get rid of the Remove option so the user never even has the option to remove a file when using the RadAsyncUpload control. Is there an option to hide the x Remove button associated with the uploaded file after it has been uploaded? Thanks for any suggestions.
0
Peter Filipov
Telerik team
answered on 03 Apr 2012, 11:51 AM
Hi David,

Regarding your enquiry you can use CSS to hide the Remove button. Please add the following style to change the RadAsyncUpload appearance:
.ruRemove
{
    display:none !important;
}


All the best,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AsyncUpload
Asked by
Dwayne
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Dwayne
Top achievements
Rank 1
David
Top achievements
Rank 1
Share this question
or