Re: [REBOL] Re: CGI, uploading file using HTTP, server side, help wan ted (max 4
From: rebol::meurrens::org at: 19-Jun-2003 20:06
--=====================_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&snip=HTTP+file+uploading">http</a><a
href="http://www.compkarori.com/cgi-local/vanilla.r?selector=display&snip=HTTP+file+uploading"
eudora="autourl">://www.compkarori.com/cgi-local/vanilla.r?selector=display&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 "cgi", "form" and "echo"
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:
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)
>>
</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: "make-cgi.r & dump-cgi.r (test/demo)" ]
<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&theme=17">http://www.codeur.org/forum/message.php?sujet=909&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--