Hi Andrew

The 4096 limit may be caused by the encoding method. I suggest you use the 
multipart/form-data. I have been able to transfer 500 Ko file without problem with it.

<FORM NAME="formulaire" METHOD="POST" ENCTYPE="multipart/form-data" 
ACTION="http://localhost/cgi-bin/uploader.r";>

Reading such encoding is a little more complex. Here is a piece of code I was working 
with some times ago. It is not complete, but it may help you see if data are sent 
correctly. I am not able to test it now because of my "I-want-to-start-a-new-life-with 
Linux" situation.

You will have to change the first line and to create a download directory in your 
cgi-bin directory.

8<- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - - - - - - 
#! d:/rebview/rebol.exe -cs
REBOL []
print "Content-Type: text/html^/^/"

query-length: to-integer system/options/cgi/content-length

data: make binary! #{}

until [
        buffer: make binary! #{}
        read-io system/ports/input buffer query-length
        append data buffer
        ((length? data) = query-length )
]

write/binary %./download/upload.bin data

parse-data: func [/talk][
        ;
        ; parsing the cgi data
        ; 
        ; data are separated by a two characters end-of-line (eol)
        eol: #{0D0A}

        ; text-boundary is often augmented with leading "-" characters
        separator: to-string copy/part data find data eol

        if talk [print [ <PRE> "separator: " separator </PRE>]]

        ; text-boundary + eol is used as a separator
        separator: join separator eol
        
        
        item: ""

        cpt-length: 0

        if parse data [
                thru separator
                some [
                        copy item
                        thru separator
                        (cpt-length: cpt-length + length? item)
                        (item: copy/part item find item separator)
                        (print [ <PRE> item </PRE> <BR> cpt-length <BR>]) 
                ]
                copy item
                thru text-boundary
                (cpt-length: cpt-length + length? item)
                (print [ <PRE> item </PRE> <BR> cpt-length <BR>]) 
                4 skip
                (cpt-length: cpt-length + 4)
                (print [<BR> cpt-length <BR>]) 

        ][ print [ <H2> "data parsing correct !" </H2>]]

        ;---------------------------7d2334b888
]

; multipart/form-data?
; Content-Type: {multipart/form-data; boundary=---------------------------7d2324888}

parse system/options/cgi/content-type [
        copy data-type 
        to ";" 
        skip 
        thru "=" 
        copy text-boundary 
        to end
]

print [
        <HTML>
        <BODY>
        <H1> "Rebol Uploader" </H1>
        <H2> "POST method" </H2>
        <PRE>  "Content-length     : " query-length </PRE>
        <PRE>  "Length data        : " length? data </PRE>
        <PRE>  "data-type          : " data-type </PRE>
        <PRE>  "text-boundary      : " text-boundary " = " length? text-boundary </PRE>
        <HR>
]

parse-data/talk

print [
        <HR>
        <PRE> mold system/options/cgi </PRE>
        </BODY>
        </HTML>
]


8<- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - - - - - - 

HTH

Patrick


>Hi!
>I've got a problem with Rebol running as a CGI process. Rebol seems to be
>limited to a maximum of 4096 bytes received from a browser's POST request of
>a edit text area through the server. I'd like to receive around 30,000 bytes
>of text from the edit box.
>
>Has anyone got suggestions I could try to increase this limit?
>
>Am I missing something?
>
>Andrew Martin
>ICQ: 26227169 http://valley.150m.com/
>-><-
>
>
>-- 
>To unsubscribe from this list, please send an email to
>[EMAIL PROTECTED] with "unsubscribe" in the 
>subject, without the quotes.


 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif


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

Reply via email to