AsyncUpload with FileUploaded Event

6 posts, 0 answers
  1. Ken
    Ken avatar
    28 posts
    Member since:
    Sep 2012

    Posted 15 May 2012 Link to this post

    Using FileExplorer with the EnableAsyncUpload="true" how do I see when the FileUploaded Event on the server side is fired?
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 16 May 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ken
    Ken avatar
    28 posts
    Member since:
    Sep 2012

    Posted 19 May 2012 Link to this post

    project builds fine with these changes but the event is never fired when the file is uploaded....
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 22 May 2012 Link to this post

    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.
  6. IT Manager
    IT Manager avatar
    11 posts
    Member since:
    Jan 2011

    Posted 22 May 2012 Link to this post

    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
  7. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 23 May 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017