Click to See Complete Forum and Search --> : JavaScript code. Need help


Konstanz
02-13-2003, 11:02 AM
I have a script:

<SCRIPT LANGUAGE="JavaScript"><!--
var filename;
function validate() {
filename = document.myform.mid.value;
}

//--></SCRIPT>

<FORM NAME="myform" onSubmit="return validate()">
<INPUT type="file" name="mid">
<INPUT TYPE="SUBMIT" NAME="mybutton">
</FORM>


Variable filename contain a path to the file that selected a user after pressing SUBMIT button.
I'd like to have a variable (for ex. string variable) that would contain the data of the selected file!
As I understand I need a code that open this file to a streem (or smth like that) and copy containing of file to my variable.

I wounder if smbd can help me with a code or sourses links or ideas.

Thanks a lot.

AdamBrill
02-13-2003, 11:38 AM
To do that, you would have to use a server-side language, such as PHP. There isn't a way do that with javascript that I know of...