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

CGI, uploading file using HTTP, server side, help wanted (max 45 seconde

 [1/13] from: rebol::meurrens::org at: 17-Jun-2003 20:14


Hello All, [ message en fran=E7ais =E0 la fin ] I need to upload files on a server in a situation where only HTTP is available. I used to do this in PHP but for some obscure reason I want to do it now in Rebol. I was really surprised that there is no standard function or script to do this in REBOL. I found a few papers and discussions, most on the client point of view. So I decided to make an object to realize this and, btw, to proceed a general situation It works. Fine. And, of course, I'll publish it as open source. But I tested the job for Win32 and IE6+. I am quite sure the object will then not be usable by all of you, running other OS and browsers. Specifically, I don't know how such OS's add their end of lines within forms, if they add some additional headers, if they encode to base64, etc, etc. Before giving the REBOL object to the community, we still need a few tests. So please upload me a very small text file (just 2 lines with abc ^/ def will do...) and a very small bin file (a small image will do). I limit the upload of each file to approx. 2kb Of course, the entire upload will be recorded so that I may inspect it. But "as a reward" the output will provide you a.o. with the 'probe of the recorded object :-) Everything, including the source code ( version 0.0.0 ) and the link to a small test form, is at URL: http://rebol.mksa.net/make-cgi/ Thanks for your cooperation. </marc> IN FRENCH: Meci de vous rendre =E0 la page ci-dessus et de m'uploader un petit fichier texte et un petit fichier image sous vos OS et navigateurs respectifs. (max 2 ko) Je suis occup=E9 =E0 remettre en =E9tat sous REBOL le syst=E8me d'=E9change de fichiers de l'Ecole de Sant=E9 Publique. Ce message s'adresse surtout =E0 ceux qui ont des OS et/ou des navigateurs un peu baroques... :-) </marc> Prof. Ir Marc Meurrens, Brussels (be) TEL: +32 (0)2 537 2812 FAX: +32 (0)2 537 7645 EMAIL: [marc--meurrens--org] URL: http://www.meurrens.org/ REB: http://rebol.mksa.net/ PGPKEY: http://www.meurrens.org/pgp/ Please don't mail me attached files, instead, use my 'exchange area' : EXCHANGE AREA: http://www.meurrens.org/exchange/ (HTTP/FTP upload/download of temporary/persistent files)

 [2/13] from: Cal::prolific::com at: 17-Jun-2003 13:01

Re: CGI, uploading file using HTTP, server side, help wan ted (max 45 se


When I tried this using Mozilla 1.4 on Windows 2000 I got the following error: Thanks for your help... our "cgi" object has been saved... find below the description of this object... ** Script Error: parse expected input argument of type: series ** Where: make-cgi ** Near: client-tld: to-word last parse client-host

 [3/13] from: andreas::bolka::gmx::net at: 17-Jun-2003 21:35

Re: CGI, uploading file using HTTP, server side, help wanted (max 45 se


Tuesday, June 17, 2003, 7:14:32 PM, Marc wrote:
> I need to upload files on a server in a situation where only HTTP is > available. I used to do this in PHP but for some obscure reason I > want to do it now in Rebol.
[...] regarding HTTP POST with mime type multipart/form-data I'd also suggest a search thru the list archive, as there have been various threads about this in the past. I've written a 'decode-multipart-form-data function (attached) which decodes multipart/form-data POST data and provides a block that tries to be as similar to the result of 'decode-cgi as possible. You might want to use this. If you have any questions, do not hesitate to ask. --- cut here - decode-multipart-form-data.r --- REBOL [ Title: "decode-multipart-form-data" Authors: [ "Andreas Bolka" ] Contributors: [ ] Date: 2003-02-22 History: [ 2002-06-18 "initial release" 2003-02-21 "major bugfixes and cleanup. example improved." 2003-02-22 "another parsing bug fixed" ] Version: 1.3 Purpose: { Decodes POST-data encoded as "multipart/form-data" as defined by RFC 2388. The output is compatible to 'decode-cgi wherever possible. So the output contains a list of set-word's and values, one pair for each data field. example: [ field1: "foo" field2: "bar" ] Parts of the form-data with content-type text/plain and no filename attribute in the content dispostition will be translated to basic name value pairs as in the example above. Parts having with a content-type different from text/plain and/or a filename attribute in their content disposition will be translated to object!'s with the following fields: filename, type, content. An example. Imagine an HTML form like the following: <form method="post" enctype="multipart/form-data"> <input type="text" name="field1" value="foo" /> <input type="file" name="field2" /> </form> Once this form is submitted with "foo" in field1 and a file called "bar.txt" containing the three bytes "nuf" in field2, this will result in the following to be returned from 'decode-multipart-form-data: [ field1: "foo" field2: make object! [ filename: "bar.txt" type: "text/plain" content: "nuf" ] ] } ] decode-multipart-form-data: func [ p-content-type p-post-data /local list ct bd delim-beg delim-end non-cr non-lf non-crlf mime-part ] [ list: copy [] if not found? find p-content-type "multipart/form-data" [ return list ] ct: copy p-content-type bd: join "--" copy find/tail ct "boundary=" delim-beg: join bd crlf delim-end: join crlf bd non-cr: complement charset reduce [ cr ] non-lf: complement charset reduce [ newline ] non-crlf: [ non-cr | cr non-lf ] mime-part: [ ( ct-dispo: content: none ct-type: "text/plain" ) delim-beg ; mime-part start delimiter "content-disposition: " copy ct-dispo any non-crlf crlf opt [ "content-type: " copy ct-type any non-crlf crlf ] crlf ; content delimiter copy content to delim-end crlf ; mime-part end delimiter ( handle-mime-part ct-dispo ct-type content ) ] handle-mime-part: func [ p-ct-dispo p-ct-type p-content /local tmp ] [ p-ct-dispo: parse p-ct-dispo {;="} append list to-set-word (select p-ct-dispo "name") either (none? tmp: select p-ct-dispo "filename") and (found? find p-ct-type "text/plain") [ append list content ] [ append list make object! [ filename: copy tmp type: copy p-ct-type content: either none? p-content [ none ] [ copy p-content ] ] ] ] use [ ct-dispo ct-type content ] [ parse/all p-post-data [ some mime-part "--" crlf ] ] list ] --- cut here - decode-multipart-form-data.r --- -- Best regards, Andreas mailto:[andreas--bolka--gmx--net]

 [4/13] from: gchiu:compkarori at: 18-Jun-2003 12:12


On Tue, 17 Jun 2003 21:35:53 +0100 Andreas Bolka <[andreas--bolka--gmx--net]> wrote:
>I've written a 'decode-multipart-form-data function >(attached) which
And I used Andreas' function a couple of months back to enable Vanilla to do http uploads :) http://www.compkarori.com/vanilla/dynasnip/upload -- Graham Chiu http://www.compkarori.com/vanilla/ Rebol Encyclopaedia Project

 [5/13] from: antonr:iinet:au at: 18-Jun-2003 15:17


Oh, that's good, so as an example, users could include their own images in their postings? I was looking for a content management system that allowed travellers from different countries to get together to exchange anecdotes and pictures etc. Anton.

 [6/13] from: gchiu:compkarori at: 18-Jun-2003 20:28


On Wed, 18 Jun 2003 15:17:14 +1000 "Anton" <[antonr--iinet--net--au]> wrote:
>Oh, that's good, so as an example, users could include >their own images in their postings?
Yes, that's the idea. I've restricted the uploads to be images or pdfs, of a limited size, and I as the Vanilla master user also get emailed so that I can check to ensure that nothing that would be inconsistent with the site gets uploaded.
>I was looking for a content management system that >allowed travellers from different countries to get >together to exchange anecdotes and pictures etc. >
Vanilla would work, and is easy enough to modify. -- Graham Chiu http://www.compkarori.com/vanilla/ Rebol Encyclopaedia Project

 [7/13] from: rebol::meurrens::org at: 19-Jun-2003 20:06

Re: Re: CGI, uploading file using HTTP, server side, help wan ted (max 4


--=====================_82796965==.ALT Content-Type: text/plain; charset="us-ascii"; format=flowed Test of the REBOL script make-cgi.r This page is at URL http://rebol.mksa.net/make-cgi/ The current version is 0.0.1 ( 18:39 19/06/2003 ) It is based on our initial version 0.0.0 and on the feedback of the REBOL community. It was deeply improved by using a script by Andreas Bolka (message 29300 on REBOL ML) also used by Graham Chiu (message 29303). Thanks to the REBOLers who also help me to developp this tool: Miguel Lopez, Nathan Meurrens, Yos, Patrick Philippot, J Cesar, Cal, Anton Rolls, Alan Wall, anonymous on Mandrake 9.0, Olivier Auverlot (for the book), Andreas Bolka (for the decode-multipart-form-data script), Mario Cassini (for detailled bug reports), Graham Chiu (for publishing articles on Vanilla). TODO Scripts should be ok now; however some tests using Mac OS X clients must still be confirmed. There are still 2 issues, indicated by XXXXXXX in the file <make-cgi.r.pretty.htm>make-cgi.r.pretty.html * XXXX-Olivier-XXXX : why is Olivier Auverlot recomputing again and again the content length at page 226 of his book ??? * XXXX-Graham-XXXX and XXXX-Andreas-XXXXX : what about Content-Transfer-Encoding mentionned near the top of page 9 of <http://www.ietf.org/rfc/rfc1867.txt>http://www.ietf.org/rfc/rfc1867.txt and suggested by Graham at page * <http://www.compkarori.com/cgi-local/vanilla.r?selector=display&snip=HTTP+file+uploading>http://www.compkarori.com/cgi-local/vanilla.r?selector=display&snip=HTTP+file+uploading ??? * See also <http://www.ietf.org/rfc/rfc1521.txt>http://www.ietf.org/rfc/rfc1521.txt on MIME TEST You may test these scripts by uploading a very small text file and a very small binary file at page <test-make-cgi.htm>test-make-cgi.php Please, no more than 2 kb ! (this page will first appear in french or english depending upon your own language; but you can of course still change to the other language) The test program shows the 'probe of the results... DOCUMENTATION The API of the make-cgi function, the "cgi", "form" and "echo" objects will be described in the future :-). Here is the result of help make-cgi
>> help make-cgi
USAGE: MAKE-CGI /max-length pp-max-length /fields-def pp-form-base /fields-valid pp-form-validation /no-form /no-echo /echo /form /no-cgi-details /no-file-details /error-function pp-error DESCRIPTION: creates a "cgi" object including a.o. modified system/options/cgi data, a "form" object and an "echo" object MAKE-CGI is a function value. REFINEMENTS: /max-length pp-max-length -- max length in bytes of the posted data (Type: integer) /fields-def pp-form-base -- object holding default form fields values (Type: object) /fields-valid pp-form-validation -- "form" object refactoring block (Type: block) /no-form -- do not fill-in the "form" object within the "cgi" object /no-echo -- do not fill-in the "echo" object within the "cgi" object /echo -- returns the "echo" object instead of the "cgi" object /form -- returns the "form" object instead of the "cgi" object /no-cgi-details -- do not provide cgi details /no-file-details -- do not provide file details /error-function pp-error -- callback function with prototype [i [integer!] a [string!] b [string!]] (Ty pe: function)
>>
DOWNLOAD The scripts are at URL's * <make-cgi.htm>make-cgi.r * <dump-cgi.htm>dump-cgi.r * <test-cgi.htm>test-cgi.r * The main script echoAll.reb is simply * #!/bin/rebol/rebol -cs * REBOL [ Title: "make-cgi.r & dump-cgi.r (test/demo)" ] * do %test-cgi.r * ;;; EOF Visit the HTMLified versions of version 0.0.1 and of some related scripts at * <make-cgi.r.pretty.htm>make-cgi.r.pretty.html * <dump-cgi.r.pretty.htm>dump-cgi.r.pretty.html * <test-cgi.r.pretty.htm>test-cgi.r.pretty.html * <andreas.r.pretty.htm>andreas.r.pretty.html (as in message 29300, but reformatted) * <graham.r.pretty.htm>graham.r.pretty.html * mirrored from <http://www.compkarori.com/vanilla/dynasnip/upload>http://www.compkarori.com/vanilla/dynasnip/upload but reformatted. LINKS Btw, other CGI related ressources are * Carl's papers are at <http://www.rebol.com/docs/cgi1.html>http://www.rebol.com/docs/cgi1.html and <http://www.rebol.com/docs/cgi2.html>http://www.rebol.com/docs/cgi2.html * Some CGI scripts are at <http://www.reboltech.com/library/script-cgi.html>http://www.reboltech.com/library/script-cgi.html * A thread on CGI, in french, <http://www.codeur.org/forum/message.php?sujet=909&theme=17>http://www.codeur.org/forum/message.php?sujet=909&theme=17 * Some threads on the REBOL ML * A group on CGI on REBOL Safeworld. * Ralp Roberts (Rebol for Dummies) chapter 18 (CGI) is online as a sample chapter. <http://www.rebolpress.com/rfd/about.html>http://www.rebolpress.com/rfd/about.html * Olivier Auverlot's printed book, in french, p. 213... Thanks again for your cooperation... Test and/or enjoy... <mailto:[Marc--Meurrens--ACM--org]>[Marc--Meurrens--ACM--org] Prof. Ir Marc Meurrens, Brussels (be) TEL: +32 (0)2 537 2812 FAX: +32 (0)2 537 7645 EMAIL: [marc--meurrens--org] URL: http://www.meurrens.org/ REB: http://rebol.mksa.net/ PGPKEY: http://www.meurrens.org/pgp/ Please don't mail me attached files, instead, use my 'exchange area' : EXCHANGE AREA: http://www.meurrens.org/exchange/ (HTTP/FTP upload/download of temporary/persistent files) --=====================_82796965==.ALT Content-Type: text/html; charset="us-ascii" <html> <body> <h2><b>Test of the REBOL script make-cgi.r</b></h2>This page is at URL <a href="http://rebol.mksa.net/make-cgi/" eudora="autourl"><b>http://rebol.mksa.net/make-cgi/</a></b> <br><br> The current version is 0.0.1 ( 18:39 19/06/2003 ) <br> It is based on our initial version 0.0.0 and on the feedback of the REBOL community. <br> It was deeply improved by using a script by Andreas Bolka (message 29300 on REBOL ML) also used by Graham Chiu (message 29303). <br><br> Thanks to the REBOLers who also help me to developp this tool: Miguel Lopez, Nathan Meurrens, Yos, Patrick Philippot, J Cesar, Cal, Anton Rolls, Alan Wall, anonymous on Mandrake 9.0, Olivier Auverlot (for the book), Andreas Bolka (for the decode-multipart-form-data script), Mario Cassini (for detailled bug reports), Graham Chiu (for publishing articles on Vanilla). <br><br> <b>TODO</b> <br><br> Scripts should be ok now; <br> however some tests using Mac OS X clients must still be confirmed. <br> There are still 2 issues, indicated by XXXXXXX in the file <a href="make-cgi.r.pretty.htm">make-cgi.r.pretty.html</a> <ul> <li>XXXX-Olivier-XXXX : why is Olivier Auverlot recomputing again and again the content length at page 226 of his book ??? <li>XXXX-Graham-XXXX and XXXX-Andreas-XXXXX : what about <u>Content-Transfer-Encoding</u> mentionned near the top of page 9 of <a href="http://www.ietf.org/rfc/rfc1867.txt">http://www.ietf.org/rfc/rfc1867.txt</a> and suggested by Graham at page <li><a href="http://www.compkarori.com/cgi-local/vanilla.r?selector=display&amp;snip=HTTP+file+uploading">http</a><a href="http://www.compkarori.com/cgi-local/vanilla.r?selector=display&amp;snip=HTTP+file+uploading" eudora="autourl">://www.compkarori.com/cgi-local/vanilla.r?selector=display&amp;snip=HTTP+file+uploading</a> ??? <li>See also <a href="http://www.ietf.org/rfc/rfc1521.txt">http://www.ietf.org/rfc/rfc1521.txt</a> on MIME </ul><br> <b>TEST</b> <br><br> <b>You may test these scripts by uploading a very small text file and a very small binary file at page <a href="test-make-cgi.htm">test-make-cgi.php</a><br> Please, no more than 2 kb !<br><br> </b><i>(this page will first appear in french or english depending upon your own language; but you can of course still change to the other language)</i> <br> The test program shows the 'probe of the results... <br><br> <b>DOCUMENTATION</b> <br><br> The API of the make-cgi function, the &quot;cgi&quot;, &quot;form&quot; and &quot;echo&quot; objects will be described in the future :-). <br> Here is the result of <b>help make-cgi</b> <br><br> <pre>>> help make-cgi USAGE: &nbsp;&nbsp;&nbsp; MAKE-CGI /max-length pp-max-length /fields-def pp-form-base /fields-valid pp-form-validation &nbsp;/no-form /no-echo /echo /form /no-cgi-details /no-file-details /error-function pp-error DESCRIPTION: &nbsp;&nbsp;&nbsp;&nbsp; creates a &quot;cgi&quot; object including a.o. modified system/options/cgi data, a &quot;form&quot; object and &nbsp;an &quot;echo&quot; object &nbsp;&nbsp;&nbsp;&nbsp; MAKE-CGI is a function value. REFINEMENTS: &nbsp;&nbsp;&nbsp;&nbsp; /max-length &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pp-max-length -- max length in bytes of the posted data (Type: integer) &nbsp;&nbsp;&nbsp;&nbsp; /fields-def &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pp-form-base -- object holding default form fields values (Type: object) &nbsp;&nbsp;&nbsp;&nbsp; /fields-valid &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pp-form-validation -- &quot;form&quot; object refactoring block (Type: block) &nbsp;&nbsp;&nbsp;&nbsp; /no-form -- do not fill-in the &quot;form&quot; object within the &quot;cgi&quot; object &nbsp;&nbsp;&nbsp;&nbsp; /no-echo -- do not fill-in the &quot;echo&quot; object within the &quot;cgi&quot; object &nbsp;&nbsp;&nbsp;&nbsp; /echo -- returns the &quot;echo&quot; object instead of the &quot;cgi&quot; object &nbsp;&nbsp;&nbsp;&nbsp; /form -- returns the &quot;form&quot; object instead of the &quot;cgi&quot; object &nbsp;&nbsp;&nbsp;&nbsp; /no-cgi-details -- do not provide cgi details &nbsp;&nbsp;&nbsp;&nbsp; /no-file-details -- do not provide file details &nbsp;&nbsp;&nbsp;&nbsp; /error-function &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pp-error -- callback function with prototype [i [integer!] a [string!] b [string!]] (Ty pe: function)
>>
</pre><b>DOWNLOAD</b> <br><br> The scripts are at URL's <ul> <li><a href="make-cgi.htm">make-cgi.r</a> <li><a href="dump-cgi.htm">dump-cgi.r</a> <li><a href="test-cgi.htm">test-cgi.r</a> <li>The main script <u>echoAll.reb</u> is simply <br><br> <li><pre>#!/bin/rebol/rebol -cs <li>REBOL [ Title: &quot;make-cgi.r &amp; dump-cgi.r (test/demo)&quot; ] <li>do %test-cgi.r <li>;;; EOF</pre><font face="Courier New, Courier"></font> </ul><br> Visit the <i>HTMLified</i> versions of version 0.0.1 and of some related scripts at <ul> <li><a href="make-cgi.r.pretty.htm">make-cgi.r.pretty.html</a> <li><a href="dump-cgi.r.pretty.htm">dump-cgi.r.pretty.html</a> <li><a href="test-cgi.r.pretty.htm">test-cgi.r.pretty.html</a> <li><a href="andreas.r.pretty.htm">andreas.r.pretty.html</a> (as in message 29300, but reformatted) <li><a href="graham.r.pretty.htm">graham.r.pretty.html</a> <li>mirrored from <a href="http://www.compkarori.com/vanilla/dynasnip/upload">http://www.compkarori.com/vanilla/dynasnip/upload</a> but reformatted. </ul><br> <b>LINKS</b> <br><br> Btw, other CGI related ressources are <ul> <li>Carl's papers are at <a href="http://www.rebol.com/docs/cgi1.html">http://www.rebol.com/docs/cgi1.html</a> and <a href="http://www.rebol.com/docs/cgi2.html">http://www.rebol.com/docs/cgi2.html</a> <li>Some CGI scripts are at <a href="http://www.reboltech.com/library/script-cgi.html">http://www.reboltech.com/library/script-cgi.html</a> <li>A thread on CGI, in french, <a href="http://www.codeur.org/forum/message.php?sujet=909&amp;theme=17">http://www.codeur.org/forum/message.php?sujet=909&amp;theme=17</a> <li>Some threads on the REBOL ML <li>A group on CGI on REBOL Safeworld. <li>Ralp Roberts (Rebol for Dummies) chapter 18 (CGI) is online as a sample chapter. <a href="http://www.rebolpress.com/rfd/about.html">http://www.rebolpress.com/rfd/about.html</a> <li>Olivier Auverlot's printed book, in french, p. 213... </ul><br> Thanks again for your cooperation... <br> Test and/or enjoy... <br><br> <a href="mailto:[Marc--Meurrens--ACM--org]">[Marc--Meurrens--ACM--org]</a><br> <x-sigsep><p></x-sigsep> Prof. Ir Marc Meurrens, Brussels (be)<br> TEL: +32 (0)2 537 2812<br> FAX: +32 (0)2 537 7645<br> EMAIL: [marc--meurrens--org]<br> URL: <a href="http://www.meurrens.org/" eudora="autourl">http://www.meurrens.org/</a><br> REB: <a href="http://rebol.mksa.net/" eudora="autourl">http://rebol.mksa.net/</a><br> PGPKEY: <a href="http://www.meurrens.org/pgp/" eudora="autourl">http://www.meurrens.org/pgp/</a><br> Please don't mail me attached files, instead, use my 'exchange area' :<br> EXCHANGE AREA: <a href="http://www.meurrens.org/exchange/" eudora="autourl">http://www.meurrens.org/exchange/</a><br> (HTTP/FTP upload/download of temporary/persistent files)<br> </body> </html> --=====================_82796965==.ALT--

 [8/13] from: rebol::meurrens::org at: 21-Jun-2003 14:49

Re: Re: CGI, uploading file using HTTP, server side, help wanted (max 4


Hello all, Here is a (temporary) synthesis of the thread on uploading file with HTTP (the server side point of view) I initiated a few days ago on the REBOL ML. Version 0.0.1.4 of make-cgi.r is online at URL http://rebol.mksa.net/make-cgi/ Provides also additional features a.o. related to the visitor's profile. Thanks to all contributors listed on this page. Most are also listed in the CC of this mail. Furthermore, there is question for OLIVIER A. on this page. Furthermore, there is another question for GRAHAM C. and for ANDREAS B. on this page. I hope Olivier, Graham and Andreas will find time to answer these questions. Or may be some others of you, of course... I'll publish a (final ?) synthesis after that. There is also on this page an answer to one of 2 questions of MARIO C. (questions in a private mail to me, but one of the answers may be interesting for all) Feel free to use the script and upload/distribute it on your rebsites. (Please keep the URL http://rebol.mksa.net/make-cgi/ so that your visitors may allways obtain the very last version and that documentation and ...credits are available to all users). Feel free to suggest improvements (I am new to REBOL...) Have a nice week-end! Regards, </marc> private PS for Mario: regarding your "uploading 2 files" issue, there was simply a very very simple typo in your script: just replace " source-data: cgi/form/OtherFile/content " by " source-data: cgi/form/AvatarFile/content " in your script and it will run perfectly. I suggest however that you use my very last version and also that you read the remark near XXXX-Mario-XXXX in my source at http://rebol.mksa.net/make-cgi/make-cgi.r.pretty.html and then remove the buggy usage of 'to-rebol-file from your script Use instead my values in cgi/form/YourFileField/path cgi/form/YourFileField/name cgi/form/YourFileField/ext Prof. Ir Marc Meurrens, Brussels (be) TEL: +32 (0)2 537 2812 FAX: +32 (0)2 537 7645 EMAIL: [marc--meurrens--org] URL: http://www.meurrens.org/ REB: http://rebol.mksa.net/ PGPKEY: http://www.meurrens.org/pgp/ Please don't mail me attached files, instead, use my 'exchange area' : EXCHANGE AREA: http://www.meurrens.org/exchange/ (HTTP/FTP upload/download of temporary/persistent files)

 [9/13] from: gchiu:compkarori at: 23-Jun-2003 9:17

Re: CGI, uploading file using HTTP, server side, help wanted (max 45 se


On Sat, 21 Jun 2003 14:49:49 +0200 Marc Meurrens <[rebol--meurrens--org]> wrote:
>I hope Olivier, Graham and Andreas will find time to >answer these questions. >Or may be some others of you, of course... >I'll publish a (final ?) synthesis after that.
Hi Marc, I put the content-transfer-encoding: base64 header in as there are a number of ways to transfer files. These include base64 and binary. I have not tested Andreas' script with binary transfers. As I suggested in http://www.compkarori.com/vanilla/display/HTTP+file+upload Rebol can do binary upload transfers ( content-transfer-encoding: binary ) as well, you just can't do it as easily using read/custom, and you have to hack the http protocol to switch in and out of lines mode. Hope that helps. -- Graham Chiu http://www.compkarori.com/vanilla/

 [10/13] from: andreas::bolka::gmx::net at: 23-Jun-2003 0:13

Re: CGI, uploading file using HTTP, server side


Saturday, June 21, 2003, 2:49:49 PM, Marc wrote:
> I hope Olivier, Graham and Andreas will find time to answer these > questions. Or may be some others of you, of course... I'll publish a > (final ?) synthesis after that.
to recap the question: why does my decode-multipart-form-data not use (or even parse) the "Content-Transfer-Encoding" header. actually, your assumption "not defined by Andreas and never encountered in the reality ???" holds true :) although i'm well aware of the various mime, multipart mime and related specs, in practice i never encountered a browser that actually uses Content-Transfer-Encoding. "Each part may be encoded and the "content-transfer-encoding" header supplied if the value of that part does not conform to the default encoding" (RFC 1867, section 3.3) the whole content-transfer-encoding stuff stems from the email background. as said before, i've never encountered it when using HTTP forms with multipart/form-data encoding. -- Best regards, Andreas mailto:[andreas--bolka--gmx--net]

 [11/13] from: gchiu:compkarori at: 23-Jun-2003 11:29


On Mon, 23 Jun 2003 00:13:27 +0200 Andreas Bolka <[andreas--bolka--gmx--net]> wrote:
>the whole content-transfer-encoding stuff stems from the >email >background. as said before, i've never encountered it >when using HTTP >forms with multipart/form-data encoding.
I had to implement a Rebol solution a couple of years whereby the contents of a multipart form were mixed with text, and binary image data. The client wanted binary transfer to avoid the overhead of base64 encoding. -- Graham Chiu http://www.compkarori.com/vanilla/

 [12/13] from: rebol:meurrens at: 23-Jun-2003 2:57


Hi, According to my observations of data recently collected on a sample of different browsers and OS (with the help of this ML): (1) I never encountered the content-transfer-encoding feature (2) The data were never base64 encoded. (3) It seems (It's 2:45 in the morning in Brussels, so I'll have a more precise look to morrow :-) ) that the default is to simply copy the bytes as they appear in the text or binary file and that this default is allways used. (4) So, in fact, *all* clients ""avoid the overhead of base64 encoding"" (5) Nevertheless, I have tried to implement content-transfer-encoding when introducing Andreas' function within my make-cgi.r script ( http://rebol.mksa.net/make-cgi/ ) just in case . (6) However, I am not sure that this implentation is really needed and (!!!) I am not sure that this implementation works because I was not able to test it, as I never found a browser sending such attribute. Thus my worry. Regards, </marc> At 11:29 23/06/2003 +1200, you wrote:
>On Mon, 23 Jun 2003 00:13:27 +0200 > Andreas Bolka <[andreas--bolka--gmx--net]> wrote:
<<quoted lines omitted: 7>>
>Graham Chiu >http://www.compkarori.com/vanilla/
Prof. Ir Marc Meurrens, Brussels (be) TEL: +32 (0)2 537 2812 FAX: +32 (0)2 537 7645 EMAIL: [marc--meurrens--org] URL: http://www.meurrens.org/ REB: http://rebol.mksa.net/ PGPKEY: http://www.meurrens.org/pgp/ Please don't mail me attached files, instead, use my 'exchange area' : EXCHANGE AREA: http://www.meurrens.org/exchange/ (HTTP/FTP upload/download of temporary/persistent files)

 [13/13] from: rebol:meurrens at: 28-Jun-2003 14:55


Hello Andreas, Hello all, I modified your 'decode-multipart-form-data script a little bit to let it process multiple form fields sharing the same name (such e.g. as a password entry field) in a way strictly similar to what is done with the 'GET method, this is by defining a block! of values. (search for the string "decode-multipart-form-data" and, specifically, near "handle-mime-part" in my source). To understand what it means for the user, fill in the example at URL http://rebol.mksa.net/make-cgi/form-files.php and watch the probe of the result. Btw, my make-cgi.r script is now mature enough to reach version number 0.1.0 and... to let me work to other things. I consider the script as finished now, at least for a while... It's available, for you all, at URL http://rebol.mksa.net/make-cgi/ The last small todo's and issues: --- content-length (Olivier + recent/current ML thread on "POST"), --- content-transfer-encoding (Graham, Andreas, RFC 1867), --- to-rebol-file (Mario), --- misc. discussions with Olivier, Graham, Andreas and Mario, etc are all solved and the synthesis of these discussions is in the abobe page and/or in the source code comments. The number of features, examples and tools was increased to encounter additional situations discussed in private mails and/or in this ML and/or on published papers: --- uploading of multiple files (Mario), --- uploading from a client REBOL script (paper of Graham + my script object.reb on the above page) --- providing a "unique" temporary name for uploaded files (my "file" object) --- etc HTH </marc>
Prof. Ir Marc Meurrens, Brussels (be) TEL: +32 (0)2 537 2812 FAX: +32 (0)2 537 7645 EMAIL: [marc--meurrens--org] URL: http://www.meurrens.org/ REB: http://rebol.mksa.net/ PGPKEY: http://www.meurrens.org/pgp/ Please don't mail me attached files, instead, use my 'exchange area' : EXCHANGE AREA: http://www.meurrens.org/exchange/ (HTTP/FTP upload/download of temporary/persistent files)

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted