By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

Accessing files and filenames from posted FORMS in server side Javascript

P: n/a
Hi,

From the following web site
http://docs.sun.com/source/816-6410-10/request.htm I have found how to
access the elements of an HTML form from server-side Javascript. Using the
"request" object built into the server the elements of the form appear under
their name as a "dot field". For example "request.user_name" or
"request.email".

What I can't understand is how to deal with file uploads where the form
element type is "file". I need BOTH the filename and some way of accessing
the contents of the file. Does anyone know how this is done?

Thanks.

Ed.
Oct 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Dummy wrote:
Hi,

From the following web site
http://docs.sun.com/source/816-6410-10/request.htm I have found how to
access the elements of an HTML form from server-side Javascript. Using the
"request" object built into the server the elements of the form appear under
their name as a "dot field". For example "request.user_name" or
"request.email".

What I can't understand is how to deal with file uploads where the form
element type is "file". I need BOTH the filename and some way of accessing
the contents of the file. Does anyone know how this is done?


That is actually a bit complicated unless your server-side tech of
choice has a File object for this.
I don't think NES has that, so you may need to roll your own. I'm not
sure.

Check out how this classic ASP FileUploader does it.
http://www.asp101.com/articles/jacob/scriptupload.asp
It is written in VBscript, but should be pretty understandable. You'd
have to translate it to javascript.

Or you could just use perl cgi instead. :)

Oct 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.