Open wnortje opened 8 years ago
I made a mistake above. The call (hunchentoot:post-parameter :content-file)
can not be used inside a Clack handler because clack.handler.hunchentoot::handle-request
reads the stream before (post-parameter)
can get to it.
So, why does the upload stream get cut after the first couple kilobytes?
I am trying to upload files as part of multipart/form-data with chunked encoding. The drakma request is:
No matter what I do, I can not get the complete uploaded file from the stream obtained from (body-parameter). The stream always ends at the same position partway into the file content.
I think the problem is in this code in http-body.multipart
I can get the complete file using
(getf (clack.request:env *request*) :raw-body-buffer)
but it is not a viable solution for big files because it loads the complete file into RAM.For the same request
(hunchentoot:post-parameter :content-file)
returns a pathname to the saved file. This is what I need, but that call breaks Clack.