Hi,
Attached is a patch with my stab at file upload capabilities for TBNL. :)
[To my defense, I first played around with rfc2388. Then I switched to TBNL and found it to be rather straight-forward to add this functionality. Only afterwards I found out about the efforts of others regarding file uploads for TBNL.]
Anyway, here's what the patch is about:
* Adds support for multipart/form-data forms.
* Can parse rfc2388 MIME data.
* Enables file upload.
* Introduces POST-PARAMETER* and POST-PARAMETERS* to give richer information about posted data (MIME headers). Also, the starred versions collate parameters with equal name into a list. + If successful, POST-PARAMETER* returns a list of MIME-PARTs, each of which can be further poked at with accessors exported from RFC2388. + POST-PARAMETERS* returns the corresponding hash-table.
* Is backwards compatible with original TBNL, although the old interface is less efficiently implemented now (conses more).
* Uses a slightly patched rfc2388.lisp (http://common-lisp.net/project/rfc2388) by Janis Dzerins, which is included completely in the patch.
* Adds a file upload example to test/test.lisp (sessions.html). It is not very polished, though.
Issues: * I tested with SBCL-0.8.15, and occasionally I get Apache "internal server errors" (caused by SIGPIPE errors on the Lisp side). It seems to be dependant on which file is uploaded. I did not look into it yet... * DOES NOT provide functionality to handle transfer encodings. The application is on its own there for now.
Mind you, the whole thing is just a first try. Perhaps it needs a better/richer API, too, but this one is simple, and works for me, YMMV.
Cheers, Michael p.s.: I noticed, there is at least one other CL rfc2388 implementation available, in mel-base.