Tag Archive: asp.net

Jul 05

Preview image file before upload to webserver

You can use javascript to preview the selected image before uploading it to the server. <html xmlns=”http://www.w3.org/1999/xhtml”> <head id=”Head1″ runat=”server”> <title>Main Page</title> <script type=”text/javascript”> function FileUpload1_onchange(oFileUpload1) { document.getElementById(‘Image1′).src = oFileUpload1.value ; } </script> </head> <body> <form id=”form1″ runat=”server”> <asp:FileUpload ID=”FileUpload1″ runat=”server” onchange=”FileUpload1_onchange(this);”/> <asp:Image ID=”Image1″ runat=”server” /> </form> </body> </html> But due to security reasons, This …

Continue reading »

Permanent link to this article: http://blog.raminassar.com/2011/07/05/preview-image-file-before-upload-to-webserver/