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

07-20-2002, 06:32 PM

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.



<!-- 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 -->



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

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

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

07-21-2002, 03: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...

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