Last post Sep 26, 2009 05:32 AM by Rajneesh Verma
Feb 25, 2007 07:16 AM|eyali.k|LINK
I am building database with photo, i the add form i am using File upload ,
I wont to see the photo when i chose here befor adding the data to db.
How can i show the photo that i chose when i chose it.
Thank u :)
Feb 27, 2007 10:36 PM|Kevin Yu - MSFT|LINK
When uploading the photo, you can set the Open File Dialog Box to thumbnail mode to preview photo.
If you need to preview it on page before uploading it, you might need to use client side script to achieve this.
Here is a sample:
HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!
Feb 28, 2007 02:49 AM|eyali.k|LINK
Thank u very much but this isnot what i meant.
I have a AddNewForm for employee, one of the filds is photo i am using fileupload to upload the file and added image control,
i want to see the chosen picture when i select it befor it is uploading to the db.
Mar 06, 2007 03:01 AM|Raymond Wen - MSFT|LINK
Mar 06, 2007 07:31 AM|eyali.k|LINK
Thank u but this is not what i need.
I am using server side (fileupload) to upload the photo to the db( working great) and image control( server side)
I need to build something that i can see in the image the chosen photo.
Mar 18, 2007 05:04 AM|eyali.k|LINK
Got It its working !!!
Thank u :) - how can i get the image as byte ?
Mar 18, 2007 08:51 PM|Raymond Wen - MSFT|LINK
Mar 19, 2007 04:12 AM|eyali.k|LINK
can u help in : http://forums.asp.net/thread/1625589.aspx
Sep 26, 2009 05:32 AM|Rajneesh Verma|LINK
Hi... Raymond Wen
Your given code........
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
var path = document.getElementById("File1").value;
var img = document.getElementById("imgPreview");
img.src = path;
<form id="form1" runat="server">
<input id="File1" type="file" onchange="ImgSelected();" />
<asp:Button ID="Button1" runat="server" Text="Button" />
<img id="imgPreview" src="" /></div>
is fine but works only in ie6 which is obsolete in these days so what shoul i do for this.................................