<div>
picture
<asp:FileUpload ID="Fud_Pic" runat="server" onchange="PreviewImg(this)" />
<br />
<br />
<br />
<asp:Label ID="Label2" runat="server"></asp:Label>
</div>
<div id="newPreview">
</div>
<asp button......="">
.cs_page
under the button click write this
if (Fud_Pic.HasFile)
{
Label1.Text = "filelength:" + Fud_Pic.FileBytes.Length
+ "<br />"
+ "filename:"
+ Fud_Pic.FileName
+ "<br />"
+ "mimetype:"
+ Fud_Pic.PostedFile.ContentType;
Fud_Pic.SaveAs(MapPath("~/images/")
+ Fud_Pic.FileName);
}
else
{
Label1.Text = "no files";
}
it works fine...........
if u need a popupimage use this javascript
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
#newPreview
{
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);
}
</style>
<script language="javascript" type="text/javascript">
function PreviewImg(imgFile)
{
var newPreview = document.getElementById("newPreview");
newPreview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
newPreview.style.width = "80px";
newPreview.style.height = "60px";
}
</script>
</head>