7

Content-Length header is missing when I try to download rar, exe, msi static files, though response for images contains Content-Length, but if I change rar extension to jpg it doesn't.

How do I solve this?

Max
  • 125
  • 1
  • 5

2 Answers2

6

What headers do you see? It's possible it's being served using Transfer-Encoding: Chunked, which is a perfectly legitimate way of transferring responses over HTTP.

Also, how are you serving the file - using static files, your code, or the blobstore?

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • You are right, it was about static files and Transfer-Encoding: Chunked. After creating a script for serving files, everything worked out and now Content-Length header is sent to the client. Thanks – Max Jun 13 '10 at 09:49
0

I tried serving a copy of http://googleappengine.googlecode.com/files/GoogleAppEngine_1.3.4.msi as a static fileand experienced the same issue - GAE's response did not include a Content-Length header.

Workaround: If the Content-Length header is critical, then consider hosting your static msi (etc.) file types on a file hosting site (e.g., Dropbox for now.

Edit: This is the intended behavior after all - Nick points out that the files are being transferred with the Transfer-Encoding: Chunked header.

David Underhill
  • 15,896
  • 7
  • 53
  • 61