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

RadAsyncUpload preview in RadBinaryImage

1 Answer 179 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Emiliano
Top achievements
Rank 1
Emiliano asked on 18 Sep 2013, 01:34 PM
Hello, I would like to display in RadBinaryImage  the image loaded in RadAsyncUpload. and temporarily stored in App_Data. 
How can I do?
thanks.

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 23 Sep 2013, 10:23 AM
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"
         TargetFolder="~/Uploads/"
         ></telerik:RadAsyncUpload>
     <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.

Regards,
Hristo Valyavicharski
Telerik
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.
Tags
AsyncUpload
Asked by
Emiliano
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or