The "theory" is that you use MIME multipart forms as 
defined in RFC1867.  Your form must be specified using  
enctype="multpart/form-data" instead of the usual 
urlencoded. Use the input tag <input type=file 
name=upld> to give the user a 'file-open' dialog box in 
the browser to select the file to upload. Each file that 
the browser then sends to the server in the upload is 
separated from the others by a unique boundary line that 
is guarenteed not to appear in the data, usually 
something like
----------------------1234567

where the digits are a pseudo-random sequence. 
Following the boundary line are a couple lines telling 
you what you've got, e.g.
-------------------------------1234567
Content-Disposition: form-data; name="myfile"; 
filename="ad.gif"
Content-Type: image/gif
<your file content>

You can parse the details directly from perl's %ENV hash 
and STDIN that the server hands you or use CGI.pm which 
takes care of the parsing and will give you a handle to 
the file.
> A quick question --
> 
> Can anyone explain the "theory" of file uploads via browser to me?  I 
> have a MS Excel spreadsheet that needs to get uploaded to a server 
> periodically and parsed.  I've written a script to do this on the 
> localhost.  But I've been asked to make this available as a 
> browser-based upload, so that users can upload the spreadsheet and it 
> will get parsed when it is uploaded.  The details I can research, but 
> the underlying concept -- anyone have a rough outline of the process 
> they can describe to me?
> 
> Thanks,
> 
> Erik
> 
> PS: I don't have any administrative privileges on this server, so I 
> can't use any modules that need to be installed as root or which 
> require additional tools ... this Solaris server doesn't even seem to 
> have the bash shell.  :(
> 
> 
> 
> 
> 
> --
> Erik Price                                   (zombies roam)
> 
> email: [EMAIL PROTECTED]
> jabber: [EMAIL PROTECTED]
> 
> _______________________________________________
> Boston-pm mailing list
> [EMAIL PROTECTED]
> http://mail.pm.org/mailman/listinfo/boston-pm
> 
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to