[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Text file i/o....
On Feb 19, 1:50pm, Luke Cassady-Dorion wrote:
> Does anyone know if it is possible to write a JS function which reads from
> a server side text file? Or would this go against the security restraints
> which JS inforces so tightly?
You want to use '<form enctype="multipart/form-data" . . .>'. Inside the form,
use the tag: "<input type=file SIZE=30 NAME= . . .>". On compatible browsers,
this will pop up a text input area with a button labeled "browse . . ." next to
it. When the user clicks on the button, they get a file selection dialog box.
Security is not compromised since the user needs to select the file to
transmit.
This is not a JavaScript feature, but instead a MIME type that is supported by
Netscape 2.0. You'll need special CGI handlers for the data that comes
through.
Check out http://140.114.63.14:6083/doc/upload.html for examples and a Perl
library to deal with multipart form data.
Brian
--
d a t a b a s e s a r e i n o u r g e n e s?
--------------------------------------------------------------------------
Brian Karlak bkarlak@panbio.com (510) 337-7910 ph
Manager, SciApps Group http://www.panbio.com (510) 522-9394 fx
--------------------------------------------------------------------------
P A N G E A S Y S T E M S I N C