[plt-scheme] CGI file upload

From: Thomas Chust (chust at web.de)
Date: Thu Aug 6 14:08:34 EDT 2009

2009/8/6 Jay McCarthy <jay.mccarthy at gmail.com>:
> [...]
> * Create a connection with
> http://svn.plt-scheme.org/plt/trunk/collects/web-server/private/connection-manager.ss
> where the i-port is (current-input-port)
> * Call read-request from
> http://svn.plt-scheme.org/plt/trunk/collects/web-server/http/request.ss
> with the connection
> * Now you have a web-server style http request.
> [...]

Hello,

I would never expect that approach to work, and a quick glance at the
code seems to confirm my doubts: A CGI program gets all the HTTP
header information passed via environment variables and can only read
the request *body* from standard input.

The read-request procedure expects to read the headers before the
body, though, so that code would have to be replaced by a problem
specific version that reconstructs the HTTP headers from the
environment.

cu,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.


Posted on the users mailing list.