Hi! I have a minor problem.
I want an file upload script to show a preview of the image that is about to
be uploaded, but I want it to resize the image to fit... say about 300x300,
no matter how big the image really is.
Here is the script:
<script type="text/javascript" language="javas cript">
<!--
function dopreview()
{
if (uploadform.use rfile.value != '')
document.getEle mentById("previ ewimage").src = 'file:///' +
uploadform.user file.value.repl ace(/\\/, '/');
else
document.getEle mentById("previ ewimage").src = 'blind.gif';
}
-->
</script>
<form name="uploadfor m" method="post" type="multipart/form-data">
<input type="text" name="test" value="diverse tekst"><br>
<input name="userfile" type="file" onChange="dopre view();">
</form>
<img id="previewimag e" src="tomt_bilde .jpg">
---------------------------------------------------------
Any suggestions will be apreciated!
Dag Eilertsen
I want an file upload script to show a preview of the image that is about to
be uploaded, but I want it to resize the image to fit... say about 300x300,
no matter how big the image really is.
Here is the script:
<script type="text/javascript" language="javas cript">
<!--
function dopreview()
{
if (uploadform.use rfile.value != '')
document.getEle mentById("previ ewimage").src = 'file:///' +
uploadform.user file.value.repl ace(/\\/, '/');
else
document.getEle mentById("previ ewimage").src = 'blind.gif';
}
-->
</script>
<form name="uploadfor m" method="post" type="multipart/form-data">
<input type="text" name="test" value="diverse tekst"><br>
<input name="userfile" type="file" onChange="dopre view();">
</form>
<img id="previewimag e" src="tomt_bilde .jpg">
---------------------------------------------------------
Any suggestions will be apreciated!
Dag Eilertsen
Comment