Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

character limit for values in a block?

 [1/4] from: ryan:christiansen:intellisol at: 2-May-2001 13:00


Is there a maximum size for a value in a block? When I used my multipart/form-data routine to upload images to my web server for display, my routine seems to choke on images over 8KB. Here is my routine again for reference. -Ryan #!rebol -cs REBOL [] print "Content-Type: text/html^/" ;-- Required Page Header content-length: 20 + load system/options/cgi/content-length post-data: make string! content-length read-io system/ports/input post-data content-length write %post-data dehex post-data ; ## DEBUG print "successful write" ; ## DEBUG post-data: make binary! post-data parse/all post-data [to "----" copy text thru "^/" (boundary: copy text)] cd-block: [] parse/all post-data [ any [thru boundary copy text [to boundary | to end] (text: make binary! text append cd-block text)]] cd-input: [] foreach cd cd-block [ either find cd "filename" [ parse/all cd [thru {name="} copy text to {"} (append cd-input text)] parse/all cd [thru {filename="} copy text to {"} (file-path-string: copy text)] file-path-block: parse/all file-path-string {\/"} filename: last file-path-block parse/all cd [thru {Content-Type: } copy text to {^M^/} (file-mime-type: copy text)] ; parse/all cd [thru {^M^/^M^/} copy text to {^M^/} (text: make binary! text append cd-input text)] parse/all cd [thru {^M^/^M^/} copy text [to boundary | to end] (text: make binary! text append cd-input text)] ][ parse/all cd [thru {name="} copy text to {"} (append cd-input text)] parse/all cd [thru {^M^/^M^/} copy text to {^M^/} (append cd-input text)] ] ] foreach item cd-input [print rejoin [newline item newline newline]] ; ## DEBUG cd-input: head cd-input object-data: make object! [] for x 1 (length? cd-input) 2 [ variable: first cd-input cd-input: next cd-input value: first cd-input either binary? value [ make-object-data: reform [rejoin [{object-data: make object-data [} (variable) {: } (value) {]}]] ][ make-object-data: reform [rejoin [{object-data: make object-data [} (variable) {: ^{} (value) {^}]}]] ] do make-object-data cd-input: next cd-input ] make-object-data: reform [rejoin [{object-data: make object-data [filename: ^{} (filename) {^}]}]] do make-object-data make-object-data: reform [rejoin [{object-data: make object-data [file-mime-type: ^{} (file-mime-type) {^}]}]] do make-object-data image-name: make file! (rejoin [{../images/} object-data/filename]) write/binary image-name object-data/file wait 4 print rejoin [{<IMG SRC="} image-name {">}] Ryan C. Christiansen Web Developer Intellisol International 4733 Amber Valley Parkway Fargo, ND 58104 701-235-3390 ext. 6671 FAX: 701-235-9940 http://www.intellisol.com Global Leader in People Performance Software _____________________________________ Confidentiality Notice This message may contain privileged and confidential information. If you think, for any reason, that this message may have been addressed to you in error, you must not disseminate, copy or take any action in reliance on it, and we would ask you to notify us immediately by return email to [ryan--christiansen--intellisol--com]

 [2/4] from: joel:neely:fedex at: 2-May-2001 14:32


Hi, Ryan, Do I correctly read in your code that you're counting on the one paragraph below: 8<------------------------------------------------------------ content-length: 20 + load system/options/cgi/content-length post-data: make string! content-length read-io system/ports/input post-data content-length 8<------------------------------------------------------------ to obtain all of your data "in fell swoop"? If so, I'm wondering if the need to loop over the input stream (which I tried in my previously-posted efforts) might be part of the picture. -jn-

 [3/4] from: ryan::christiansen::intellisol::com at: 2-May-2001 16:04


I'll look for that discussion. Thanks a bunch! Ryan C. Christiansen Web Developer Intellisol International 4733 Amber Valley Parkway Fargo, ND 58104 701-235-3390 ext. 6671 FAX: 701-235-9940 http://www.intellisol.com Global Leader in People Performance Software _____________________________________ Confidentiality Notice This message may contain privileged and confidential information. If you think, for any reason, that this message may have been addressed to you in error, you must not disseminate, copy or take any action in reliance on it, and we would ask you to notify us immediately by return email to [ryan--christiansen--intellisol--com] Joel Neely <[joel--neely--f] To: [rebol-list--rebol--com] edex.com> cc: Sent by: Subject: [REBOL] Re: character limit for values in a block? rebol-bounce@ rebol.com 05/02/2001 02:32 PM Please respond to rebol-list Hi, Ryan, Do I correctly read in your code that you're counting on the one paragraph below: 8<------------------------------------------------------------ content-length: 20 + load system/options/cgi/content-length post-data: make string! content-length read-io system/ports/input post-data content-length 8<------------------------------------------------------------ to obtain all of your data "in fell swoop"? If so, I'm wondering if the need to loop over the input stream (which I tried in my previously-posted efforts) might be part of the picture. -jn-

 [4/4] from: ryan:christiansen:intellisol at: 2-May-2001 16:32


Is this what you are referring to? http://www.escribe.com/internet/rebol/m4260.html Ryan C. Christiansen Web Developer Intellisol International 4733 Amber Valley Parkway Fargo, ND 58104 701-235-3390 ext. 6671 FAX: 701-235-9940 http://www.intellisol.com Global Leader in People Performance Software _____________________________________ Confidentiality Notice This message may contain privileged and confidential information. If you think, for any reason, that this message may have been addressed to you in error, you must not disseminate, copy or take any action in reliance on it, and we would ask you to notify us immediately by return email to [ryan--christiansen--intellisol--com] Joel Neely <[joel--neely--f] To: [rebol-list--rebol--com] edex.com> cc: Sent by: Subject: [REBOL] Re: character limit for values in a block? rebol-bounce@ rebol.com 05/02/2001 02:32 PM Please respond to rebol-list Hi, Ryan, Do I correctly read in your code that you're counting on the one paragraph below: 8<------------------------------------------------------------ content-length: 20 + load system/options/cgi/content-length post-data: make string! content-length read-io system/ports/input post-data content-length 8<------------------------------------------------------------ to obtain all of your data "in fell swoop"? If so, I'm wondering if the need to loop over the input stream (which I tried in my previously-posted efforts) might be part of the picture. -jn-