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

AsyncUpload with FileUploaded Event

5 Answers 183 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 15 May 2012, 02:43 PM
Using FileExplorer with the EnableAsyncUpload="true" how do I see when the FileUploaded Event on the server side is fired?

5 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 16 May 2012, 10:19 AM
Hi Ken,

You can access the RadFileExplorer's underlying RadAsyncUpload using the corresponding property (AsyncUpload) and you can use the returned reference to assign the FileUploaded server-side event's handler, e.g.:
protected void Page_Load(object sender, EventArgs e)
{
    RadFileExplorer1.AsyncUpload.FileUploaded += new FileUploadedEventHandler(AsyncUpload_FileUploaded);
}
 
void AsyncUpload_FileUploaded(object sender, FileUploadedEventArgs e)
{
    //.....
}


Greetings,
Dobromir
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.
0
Ken
Top achievements
Rank 1
answered on 19 May 2012, 10:23 PM
project builds fine with these changes but the event is never fired when the file is uploaded....
0
Dobromir
Telerik team
answered on 22 May 2012, 07:49 AM
Hi Ken,

Please accept my apologies for providing misleading information with my previous answer. Actually RadFileExplorer does not expose the entire functionality of the AsyncUpload. Could you please provide more detailed information regarding the usage for this event with RadFileExplorer so we can think of an alternate approach?

Is the RadFileExplorer's ItemCommand event not usable for your scenario?

Kind regards,
Dobromir
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.
0
IT Manager
Top achievements
Rank 1
answered on 22 May 2012, 12:59 PM
This is in another item which you can remove

I  have a single file upload using upload in fileexplorer upon completion on the upload I would like to get the name of the file just uploaded and redirect the page. I cannot find an event that if fired when upload is complete... thanks
0
Dobromir
Telerik team
answered on 23 May 2012, 10:56 AM
Hi Ken,

Thank you for the provided additional information.

The RadFileExplorer's ItemCommand event can be used to achieve the required functionality - you can get the name of the uploaded file from the event argument's Path property, e.g.:
protected void RadFileExplorer1_ItemCommand(object sender, Telerik.Web.UI.RadFileExplorerEventArgs e)
{
    if (e.Command == "UploadFile")
    {
        string fileName = e.Path.Substring(e.Path.LastIndexOf('/') + 1);
        Response.Redirect(String.Format("~/Default2.aspx?filePath={0}", fileName));
    }
}


All the best,
Dobromir
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
Ken
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Ken
Top achievements
Rank 1
IT Manager
Top achievements
Rank 1
Share this question
or