Asp.net uses FileUpload in ie7 to preview images before uploading
Due to security issues, IE7 disabled the image control to reference local images. After several days of being depressed for this problem, I finally found a solution. I want to share some good things with you. The Code is as follows:
This code segment is stored between FILTER: progid: DXImageTransform. Microsoft. AlphaImageLoader (sizingMethod = scale)
}
</Style>
<Body> Internal Code <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>
<Asp: FileUpload ID = "Fud_Pic" runat = "server" onchange = "PreviewImg (this)"/> <div id = "newPreview"> </div>