Accessing files and filenames from posted FORMS in server side Javascript

D

Dummy

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.
 
N

nikki

Dummy said:
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. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top