...

View Full Version : Choose file won't work on submit form... Please Help



Rich
07-20-2002, 05:32 PM
Hi,

I put a java script in a form which allows the user to choose a file to send with the rest of the form answers. JUST LIKE THE ONE IN THE "POST NEW THREAD" PAGE ON THIS SITE. This is the script below. It browses for the file and it also lets the user view the file too, but I do not receive it in the email with the rest of the info. Should this be a CGI script I am looking for instead of a java script to let the user browse and also submit? Or, maybe it's the wrong script. If not, I can post the rest of the HTML from that page later. Thanks.

Rich


<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Hoop Hooper (hooper119@aol.com) -->
<!-- Web Site: http://www.angelfire.com/pa3/muddas -->
<!-- Modified: Larry McClurg (larry@honeybells.com) -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Thank you Larry McClurg for the cross-browser fix
function whatFile() {
window.location= 'file:///' + document.form1.cmuds.value;
}
// End -->
</script>

</HEAD>

<BODY>

<form name=form1>
<input type=file name="cmuds">
<input type=button onClick="whatFile()" value="Open File">
</form>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.09 KB -->:)

caldasgsm
07-21-2002, 02:45 AM
frist you have to put in the form tag
<form enctype="multipart/form-data"
or else the file input won't upload the file..
secon you must have a proper server-side code that can
handle the upload...

premshree
07-21-2002, 02:25 PM
Well, the script above just navigates to a local file that you browse to...........so it does not require server-side processing.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum