# Upload\_resume sha1, md5 and crc32 aggregates missing

**URL:** <https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618>\
**Category:** NGINX\
**Created:** [October 8, 2011, 2:20am UTC](https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618 "2011-10-08T02:20:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 8, 2011, 2:20am UTC](https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618/1 "2011-10-08T02:20:02Z")

</div>

I’m seeing most, but not all of the upload form fields get set. However,  
the  
sha1, md5 and crc32 aggregates below are blanks:

request.POST \<QueryDict: {  
u’upload\_name’: [u’py\_lightweight\_uploader.py’],  
u’upload\_size’: [u’11345’],  
u’upload\_sha1’: [u’’],  
u’upload\_content\_type’: [u’text/x-python’],  
u’upload\_path’: [u’/var/lib/nginx/resumable\_download/7/64565707’],  
u’upload\_md5’: [u’’],  
u’upload\_crc32’: [u’’]}\>

I see that libssl is installed on the server. I don’t see any entries in  
the  
error log that would make me think there is anything failing here. I  
have  
the following in the nginx config:

upload\_set\_form\_field upload\_name $upload\_file\_name;  
upload\_set\_form\_field upload\_content\_type $upload\_content\_type;  
upload\_set\_form\_field upload\_path $upload\_tmp\_path;  
upload\_aggregate\_form\_field upload\_sha1 $upload\_file\_sha1;  
upload\_aggregate\_form\_field upload\_size $upload\_file\_size;  
upload\_aggregate\_form\_field upload\_crc32 $upload\_file\_crc32;  
upload\_aggregate\_form\_field upload\_md5 $upload\_file\_md5;

I based the above on the documentation and example config. What am I  
missing  
here? I’m using nginx 1.0.8 deb-src build from the PPA with the latest  
version of the upload\_resume module included.

Andrew

---

<div class="post-metadata">

**Author:** ![pond](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7ab992/32.png) [@pond](https://www.ruby-forum.com/u/pond)\
**Post date:** [October 8, 2011, 5:56pm UTC](https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618/2 "2011-10-08T17:56:34Z")

</div>

These aggregates are not available for resumable uploads, as hashes of  
the last part will not make sense anyway.

----- Andrew H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> u’upload\_crc32’: [u’']}\>  
> upload\_aggregate\_form\_field upload\_crc32 $upload\_file\_crc32;  
> upload\_aggregate\_form\_field upload\_md5 $upload\_file\_md5;
> 
> I based the above on the documentation and example config. What am I missing  
> here? I’m using nginx 1.0.8 deb-src build from the PPA with the latest  
> version of the upload\_resume module included.

–  
Regards,  
Valery K.

---

<div class="post-metadata">

**Author:** ![pond](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7ab992/32.png) [@pond](https://www.ruby-forum.com/u/pond)\
**Post date:** [October 11, 2011, 12:00am UTC](https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618/3 "2011-10-11T00:00:11Z")

</div>

The documentation says they are supported (and for the entire uploaded  
file):

[http://www.grid.net.ru/nginx/upload.en.html#upload\_aggregate\_form\_field](http://www.grid.net.ru/nginx/upload.en.html#upload_aggregate_form_field)  
\*

and following additional special variables:  
\*  
\*

- $upload\_file\_md5 – MD5 checksum of the file
- $upload\_file\_md5\_uc – MD5 checksum of the file in uppercase  
letters
- $upload\_file\_sha1 – SHA1 checksum of the file
- $upload\_file\_sha1\_uc – SHA1 checksum of the file in uppercase  
letters
- $upload\_file\_crc32 – hexdecimal value of CRC32 of the file

- 

_The value of a field specified by this directive is evaluated after  
successful upload of the file, thus these variables are valid only at  
the  
end of processing of one part of original request body._

Since I’m seeing the following in my error log, I believe the upload was  
successful… so the variables should be valid, right?

2011/10/10 14:56:07 [debug] 9844#0: \*91 http script var:  
“/var/lib/nginx/upload\_resume/3/34313583”  
2011/10/10 14:56:07 [info] 9844#0: \*91 started uploading part  
204800-209999/210000 of file “test\_trans” to  
“/var/lib/nginx/upload\_resume/3/34313583” (field “”, content type  
“application/octet-stream”), client: 10.178.51.115, server:  
[account.nutricateonline.com](http://account.nutricateonline.com), request: “POST  
/rspool/?id=test&sha1=00000000  
HTTP/1.0”, host: “209.114.46.109”  
2011/10/10 14:56:07 [debug] 9844#0: \*91 write: 17, 00000000023D3DB7,  
665,  
204800  
2011/10/10 14:56:07 [debug] 9844#0: \*91 write: 17, 00000000023CC420,  
4535,  
205465  
2011/10/10 14:56:07 [debug] 9844#0: \*91 read: 17, 00000000023CAC77, 16,  
0  
2011/10/10 14:56:07 [debug] 9844#0: \*91 a 0-209999/210000  
2011/10/10 14:56:07 [debug] 9844#0: \*91 write: 17, 00000000023CA838, 16,  
0  
2011/10/10 14:56:07 [info] 9844#0: \*91 removed state file  
“/var/lib/nginx/upload\_resume/3/34313583.state”, client: 10.178.51.115,  
server: [account.nutricateonline.com](http://account.nutricateonline.com), request: “POST  
/rspool/?id=test&sha1=00000000 HTTP/1.0”, host: “209.114.46.109”  
2011/10/10 14:56:07 [info] 9844#0: \*91 finished uploading file  
“test\_trans”  
to “/var/lib/nginx/upload\_resume/3/34313583”, client: 10.178.51.115,  
server:  
[account.nutricateonline.com](http://account.nutricateonline.com), request: “POST  
/rspool/?id=test&sha1=00000000  
HTTP/1.0”, host: “209.114.46.109”

I’d love to get this sorted out. Anyone?

Andrew

On Sat, Oct 8, 2011 at 8:55 AM, Valery K.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![pond](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7ab992/32.png) [@pond](https://www.ruby-forum.com/u/pond)\
**Post date:** [October 11, 2011, 11:14am UTC](https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618/4 "2011-10-11T11:14:54Z")

</div>

My fault, I’ll change it to “not available for resumable uploads”.

Note: body part != file segment.

----- Andrew H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> - $upload\_file\_md5 – MD5 checksum of the file  
> Since I’m seeing the following in my error log, I believe the upload was  
> 2011/10/10 14:56:07 [debug] 9844#0: \*91 write: 17, 00000000023D3DB7, 665,  
> 2011/10/10 14:56:07 [info] 9844#0: \*91 finished uploading file “test\_trans”
> 
> > wrote:
> > 
> > > request.POST \<QueryDict: {  
> > > error log that would make me think there is anything failing here. I have  
> > > I based the above on the documentation and example config. What am I  
> > > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> > > [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

## –

Regards,  
Valery K.

---

<div class="post-metadata">

**Author:** ![pond](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7ab992/32.png) [@pond](https://www.ruby-forum.com/u/pond)\
**Post date:** [October 13, 2011, 11:18pm UTC](https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618/5 "2011-10-13T23:18:09Z")

</div>

So, these are available if the entire file upload happens in a single  
HTTP  
transaction. But if there are multiple HTTP transactions (as in  
resumable  
uploads) then their value is not available. Right?

A

On Tue, Oct 11, 2011 at 2:14 AM, Valery K. \<

---

<div class="post-metadata">

**Author:** ![pond](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7ab992/32.png) [@pond](https://www.ruby-forum.com/u/pond)\
**Post date:** [October 14, 2011, 8:09am UTC](https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618/6 "2011-10-14T08:09:06Z")

</div>

Right.

----- Andrew H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > 2011/10/10 14:56:07 [info] 9844#0: \*91 started uploading part  
> > > 205465  
> > > to “/var/lib/nginx/upload\_resume/3/34313583”, client: 10.178.51.115,  
> > > On Sat, Oct 8, 2011 at 8:55 AM, Valery K. \<  
> > > However,
> > > 
> > > > > u’upload\_crc32’: [u’']}\>  
> > > > > upload\_set\_form\_field upload\_path $upload\_tmp\_path;
> > 
> > ## –
> > 
> > Regards,  
> > Valery K.
> > 
> > * * *
> > 
> > nginx mailing list  
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> > [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

## –

Regards,  
Valery K.

---

<div class="post-metadata">

**Author:** ![pond](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7ab992/32.png) [@pond](https://www.ruby-forum.com/u/pond)\
**Post date:** [October 14, 2011, 1:30am UTC](https://www.ruby-forum.com/t/upload-resume-sha1-md5-and-crc32-aggregates-missing/212618/7 "2011-10-14T01:30:28Z")

</div>

I tested this with smaller files and see that these are never populated  
for  
any resumable uploads.

A

On Thu, Oct 13, 2011 at 2:17 PM, Andrew H. \<
