[drakma-devel] Problem with file uploading

Edi Weitz edi at agharta.de
Mon Feb 12 21:01:50 UTC 2007


On Mon, 12 Feb 2007 15:44:40 -0500, "Andrei Stebakov" <lispercat at gmail.com> wrote:

> (drakma:http-request "/some/uri"
>                      :method :post :form-data t

For file uploads you don't need the ":FORM-DATA T" part.

>                      :parameters `(("Name1" . ,name1)
>                                    ("Name2" . ,name2)
>                                    ("File" . ,file-name)))

Without knowing what "/some/uri", NAME1, NAME2, and FILE-NAME are this
is hard to say.  Is FILE-NAME really a pathname object?

Or maybe the receiving web server can't cope with chunked transfer
encoding (like Apache 1.x)?  Then you'll have to add

  :CONTENT-LENGTH T

to the call, but note that this will force Drakma to compose the whole
request body in RAM before sending it which might not work for /very/
large files.

HTH,
Edi.



More information about the Drakma-devel mailing list