PDA

View Full Version : Javascript local machine file permissions


cozenage
07-15-2002, 06:05 PM
I have a page that lets a user upload pages to a web site. I would like to be able to allow the user to actually see the image that they are about to upload from within the web page.

EXAMPLE
User clicks browse to look for image. After image is located, a preview of the actual image is loaded on to the same page. Can this be done? It is for an intraned application, so if necessary/possible, I could make changes to all browsers.

thanks

tamienne
07-16-2002, 06:32 PM
<HTML>
<HEAD>
<SCRIPT>
<!--
function showSample() {
url=document.forms[0].filename.value;
window.open(url,"preview");
}
//-->
</SCRIPT>
</HEAD>
<BODY>

<FORM>
<INPUT NAME="filename" TYPE="FILE">
<BR>
<INPUT TYPE="BUTTON" VALUE="Preview" onClick="showSample()">
</FORM>

</BODY>
</HTML>

You should get the gist of it using this.