simple module question

Manlio Perillo manlio_perillo at libero.it
Tue Jul 15 12:14:20 MSD 2008


Valery Kholodkov ha scritto:
> [...]
>>> I'm actually working now on the next version of this module which 
>>> will be able to cut out and store uploaded files in temporal 
>>> directory and proxy the remaining part of the body to a backend with 
>>> brief information about files uploaded.
>>>
>>
>> My idea is to:
>> 1) Modify the content-type from multipart/form-data to
>>    application/x-www-form-urlencoded
>> 2) Any non file parts are urlencoded and written to the new body
>> 3) Files are written to temporary files, and in the new body is written:
>>    name.filename=filename&name.path=path&name.content-type=content-type
>>    where name is the field name and path is the temporary path used to
>>    store the file.
>>
>> With this method an application needs only to care about urlencoded 
>> request body.
> 
> The problem with application/x-www-form-urlencoded is that it is 
> percent-encoded and multipart/form-data is not, thus requiring us to 
> deal with encoding, etc. Dealing with encodings is generally a bad idea 
> and I prefer to think about request body as a stream of bytes.
> 

You are right, your method is more correct.


Thanks  Manlio Perillo





More information about the nginx mailing list