Upload Module - add response header with MD5

Valery Kholodkov valery+nginxen at grid.net.ru
Tue Aug 21 08:37:53 UTC 2012


Aggregate variables cannot be used in upload_add_header directive, because they are not valid outside of a request body part.

----- mokriy <nginx-forum at nginx.us> wrote:
> Hi!
> here is the snuppet of configuration I use for uploading:
> location /upload {
>                 auth_request /auth;
>                 upload_pass /200;
>                 upload_store /download 1;
> 
>                 upload_resumable on;
> 
>                 #Return download path to calling party in custom header
> value
>                 upload_add_header XXX-DownloadURI "$upload_tmp_path";
>                 #Return md5 file checksum to calling party as custome header
> value
>                 upload_add_header X-XXX-MD5SizeChecksum "$upload_file_md5";
>                 upload_add_header X-XXXXr-FileSize "$upload_file_size";
> 
>                 upload_aggregate_form_field "$upload_field_name.md5"
> "$upload_file_md5";
>                 upload_aggregate_form_field "$upload_field_name.size"
> "$upload_file_size";
> 
> It works perfect, great job, thanks! Specially about upload_add_header.
> However the MD5 hashes returned in response header are.. not hashes. 
> They are:
> 34383765656261393461336230613362 OR
> 34396436323764343839623564646664
> I can't rely on them on caller side..
> 
> Could it be a problem with add_header? I assume that aggregate field is
> generated correctly, however when setting it to header via
> upload_add_header, there is an convertion mistake.
> 
> Many thanks in advance!
> You are doing great Job
 
-- 
Regards,
Valery Kholodkov



More information about the nginx mailing list