some questions about the upload module

Valery Kholodkov valery+nginxen at grid.net.ru
Tue Sep 9 21:59:28 MSD 2008


Manlio Perillo wrote:

>> Yes, the data is the same multipart/form-data, but extra parameters are
>> added as fields.
>>
>
> Can you make an example, using this sample data (from HTML 4.2 spec)?
>
> Content-Type: multipart/form-data; boundary=AaB03x
>
>     --AaB03x
>     Content-Disposition: form-data; name="submit-name"
>
>     Larry
>     --AaB03x
>     Content-Disposition: form-data; name="files"; filename="file1.txt"
>     Content-Type: text/plain
>
>     ... contents of file1.txt ...
>     --AaB03x--

Assuming:

upload_set_form_field "${upload_field_name}_name" "$upload_file_name";
upload_set_form_field "${upload_field_name}_type" "$upload_content_type";
upload_set_form_field "${upload_field_name}_path" "$upload_tmp_path";

--AaB03x
Content-Disposition: form-data; name="submit-name"

Larry
--AaB03x
Content-Disposition: form-data; name="files_name"

file1.txt
--AaB03x
Content-Disposition: form-data; name="files_type"

text/plain
--AaB03x
Content-Disposition: form-data; name="files_path"

<path_temporary_file>
--AaB03x--

Where file <path_temporary_file> holds contents of file1.txt.

-- 
Best regards,
Valery Kholodkov





More information about the nginx mailing list