Hi @Donald Symmons , You can get the bytes of the uploaded file and pass it to the Image control.
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Image ID="Image1" runat="server" />
<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="Upload" />
protected void Upload(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
int fileLen;
// Get the length of the file.
fileLen = FileUpload1.PostedFile.ContentLength;
byte[] input = new byte[fileLen - 1];
input = FileUpload1.FileBytes;
byte[] fileBytes = new byte[FileUpload1.PostedFile.ContentLength];
Image1.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(input.ToArray(), 0, input.ToArray().Length);
}
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.