[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] reading file from post request

From: Nathaniel Rudavsky-Brody
Subject: [Chicken-users] reading file from post request
Date: Sat, 09 Aug 2014 17:40:31 +0002


In an Awful web app, I'm trying to read an image posted as raw data to the server, since it seems multipart/form-data isn't supported. (Is that right?) But I get the feeling I'm missing something regarding ports and requests...

I *think* my basic question is, how do I know the request is finished? But more than that, is there a better way to be going this?

I've got something like:

 (with-output-to-file "media/image.jpg"                                                              
          (lambda ()                                                                                      
            (port-map write-byte
(lambda () 
(read-byte (request-port (current-request)))))))

; never gets here

With JSON objects this wasn't a problem, using Medea: 

(read-json (request-port (current-request)) consume-trailing-whitespace: #f)

Thanks a lot for any help,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]