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

Custom Handler - OnFileUploaded not working

2 Answers 113 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
JNG
Top achievements
Rank 1
JNG asked on 16 Sep 2015, 06:53 PM

I'm trying to save uploaded files into a db and return the row id.  I'm having significant problems with getting the uploaded files from the RadTreeView node.  The application allows users to drag/drop a file onto a node. This part is working. However, on the server side, the uploadedfiles is always empty.  So I implemented a custom handler and I can access and save the file at that point. However, I can not access the results object that is returned because my OnFileUploaded event is not getting fired. I need the returned file id so I can open a new window.

I have a hidden button that is clicked via the OnClientFileUploaded event by doing a postback on the hidden button. 

Here's my control:

   <rad:RadAsyncUpload runat="server" ID="radUpload" OnClientFilesUploaded="OnClientFilesUploaded" PostbackTriggers="btnUploadFiles"
  DisableChunkUpload="false" EnableFileInputSkinning="false" UploadedFilesRendering="AboveFileInput"  MultipleFileSelection="Automatic" Skin="Default" OnFileUploaded="RadAsyncUpload1_FileUploaded"   OverwriteExistingFiles="true"  OnClientAdded="OnClientAdded" HttpHandlerUrl="~/Tools/CustomHandler.ashx">

 

Is there another way to access the results object without using the OnFileUploaded event?  

 

2 Answers, 1 is accepted

Sort by
0
JNG
Top achievements
Rank 1
answered on 16 Sep 2015, 07:22 PM

I figured out how to do it on the client side. In the OnClientFileUploaded event, I can access the results object with args.get_fileInfo().

Still curious to know why the OnFileUploaded never gets fired.

0
Jayzle
Top achievements
Rank 1
answered on 17 Sep 2015, 01:05 AM

Hi JNG,

 I think OnFileUploaded is a server side event and will be triggered by a postback.

OnClientFileUploaded on the other hand is a client side event and will be triggered after RadAsyncUpload do an async upload.

Tags
AsyncUpload
Asked by
JNG
Top achievements
Rank 1
Answers by
JNG
Top achievements
Rank 1
Jayzle
Top achievements
Rank 1
Share this question
or