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

How to run a method to read a file after this file was uploaded

1 Answer 33 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Khoa Ho
Top achievements
Rank 1
Khoa Ho asked on 06 Feb 2013, 05:38 AM
Hi,

I can't find an event that will fire after an event ItemCommand is finished. The event handler ItemCommand (radFileExplorerEventArgs.Command == "UploadFile") is fired before a file is actually uploaded to a specified directory. After this file is saved to a server, I want to call another method to read that file.

Thank you,
Khoa

1 Answer, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 08 Feb 2013, 03:39 PM
Hi Khoa,

You could access the uploaded file in the handler of the AsyncUpload's FileUploaded Server Event (it is called after the FileExplorer's ItemCommand event):
protected void Page_Load(object sender, EventArgs e)
{
    RadFileExplorer1.Configuration.EnableAsyncUpload = true;
    RadFileExplorer1.AsyncUpload.FileUploaded += new FileUploadedEventHandler(AsyncUpload_FileUploaded);
}
 
protected void AsyncUpload_FileUploaded(object sender, FileUploadedEventArgs e)
{
    var uploadedFile = e.File;
    //your logic here
}

Kind Regards,
Vesi
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
FileExplorer
Asked by
Khoa Ho
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or