Accessing files and filenames from posted FORMS in server side Javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dummy

    Accessing files and filenames from posted FORMS in server side Javascript

    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_n ame" 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.


  • nikki

    #2
    Re: Accessing files and filenames from posted FORMS in server side Javascript


    Dummy wrote:[color=blue]
    > 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_n ame" 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?
    >[/color]

    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.
    This website is for sale! asp101.com is your first and best source for information about asp101. Here you will also find topics relating to issues of general interest. We hope you find what you are looking for!

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

    Comment

    Working...