I haven't been following this thread, but I have written HTTP upload 
scripts for a few sites.  Here's an excerpt from one of them that I hope 
will help.

#!/usr/local/bin/rebol/rebol -cs
REBOL []

print "Content-type: text/html^/^/"

if error? err: try [
input-cgi: func [/local buffer stdin] [
     buffer: copy ""
     either system/options/cgi/request-method = "POST" [
         until [
             stdin: make string! 4000
             read-io system/ports/input stdin 4000
             append buffer stdin
             zero? length? stdin
         ]
         return buffer
     ][system/options/cgi/query-string]
]

;probe <PRE>
cgi: replace/all replace/all input-cgi "^J" "^M" "^M^J" "^M"
;probe </PRE>

write/append %access.log reform [%batch now system/options/cgi/remote-addr 
system/options/cgi/query-string newline]

query: make object! []

if find cgi "^M^MContent-Disposition:" [replace/all cgi "^M^M" "^M"]
while [cgi: find/tail cgi {name="}][
     nm: copy/part cgi find cgi {"}
     cgi: find/tail cgi "^M^M"
     data: copy/part cgi cgi: find cgi "^M--"
     query: make query compose [(to-set-word nm) data]
]

error? try [write %batch.txt mold query true]
...
][handle-error]

It may be a bit of a hack, but it's been getting the job done for the past 
year or so.

Have fun!

Bohdan "Bo" Lechnowsky
Lechnowsky Technical Consulting


At 06:12 AM 8/29/02 -0400, you wrote:
>http://cgi.resourceindex.com/Programs_and_Scripts/Perl/File_Management/File_Uplo
>ading/
>
>Lots of Perl scripts for file upload over http.
>Hopefully some of these will be translated into Rebol
>
>./Jason
>
>--
>To unsubscribe from this list, please send an email to
>[EMAIL PROTECTED] with "unsubscribe" in the
>subject, without the quotes.

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to