RadAsyncUpload preview in RadBinaryImage

2 posts, 0 answers
  1. Emiliano
    Emiliano avatar
    8 posts
    Member since:
    Aug 2013

    Posted 18 Sep 2013 Link to this post

    Hello, I would like to display in RadBinaryImage  the image loaded in RadAsyncUpload. and temporarily stored in App_Data. 
    How can I do?
  2. Hristo Valyavicharski
    Hristo Valyavicharski avatar
    975 posts

    Posted 23 Sep 2013 Link to this post

    Hi Emiliano,

    It is not a good idea to display images from the Temporary folder, because it is cleared periodically. Better display it from the Target folder.
    <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" MaxFileInputsCount="1" OnFileUploaded="RadAsyncUpload1_FileUploaded"
         <telerik:RadButton ID="rbUpload" runat="server" Text="Upload"></telerik:RadButton>
         <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" />

    protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
        string ext = e.File.GetExtension();
        if (ext == ".png" || ext == ".png")
            RadBinaryImage1.ImageUrl = "Uploads/" + e.File.FileName;

    This Code Library shows how to preview selected images on the client.

    Hristo Valyavicharski
    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 the blog feed now.
Back to Top