AsyncUpload : Uploaded files clickable

5 posts, 0 answers
  1. Charm
    Charm avatar
    3 posts
    Member since:
    Sep 2012

    Posted 21 Sep 2012 Link to this post

    Hi Telerik Team,

    Would like to ask some assistance if there's a way to make the uploaded files clickable using the RadAsyncUpload.
    E.g 
        I uploaded a file Sample.pdf, when successfully uploaded, i want to click that file and download it.


    Thank you in advance.
    Charm
  2. Charm
    Charm avatar
    3 posts
    Member since:
    Sep 2012

    Posted 22 Sep 2012 Link to this post

    Hello again,

    Any feedback with regards to my concern?
    Thank you.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 25 Sep 2012 Link to this post

    Hi Charm, 

     
    One possible way to achieve similar behavior is to use RadButton and the FileUploaded server event of RadAsyncUpload as in the code below:

    <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" MultipleFileSelection="Automatic" TargetFolder = "../../TargetFolderB/"
                OnFileUploaded="AsyncUpload1_FileUploaded">
            </telerik:RadAsyncUpload>
            <telerik:RadButton runat="server" ID="RadButton2" Text="submit">
            </telerik:RadButton>
            <telerik:RadButton runat="server" ID="RadButton1" Visible="false" ButtonType="LinkButton">
            </telerik:RadButton>
    protected void AsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
       {
           string targetFolder = AsyncUpload1.TargetFolder;
           string fileName = e.File.GetName();
           RadButton1.Visible = true;
           RadButton1.Text ="DownLoadFile-"+ e.File.GetNameWithoutExtension();
           RadButton1.NavigateUrl = targetFolder + fileName;
           RadButton1.Target = "_blank";
       }

    Hope this will be helpful.

    All the best,
    Plamen
    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.
  5. Charm
    Charm avatar
    3 posts
    Member since:
    Sep 2012

    Posted 27 Sep 2012 Link to this post

    Hi Plamen,

    Thank you for the response.
    I tried your code below but the link button is not displayed when the files are uploaded.
    Is there any other workaround with this?
    Thanks.
  6. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 02 Oct 2012 Link to this post

    Hi,

     
    I have tested the issue once again and it worked properly at my side once again. Here is a video of my test. If your scenario is somehow different please elaborate it a little bit so we can be more helpful.

    Hope this will be helpful you.

    All the best,
    Plamen
    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