Hi,

I have been having some trouble fetching a zip or gzip file with Google App 
Engine. I kept getting this exception:


java.io.IOException: Could not fetch URL: http://path_to_my_file?format=zip
>     at 
> com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:115)
>     at 
> com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:42)
>     at 
> com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.fetchResponse(URLFetchServiceStreamHandler.java:418)
>     at 
> com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getInputStream(URLFetchServiceStreamHandler.java:297)
>     at java.net.URL.openStream(URL.java:1029)
>



I could fetch other files from the same domain so I dug in a bit further. I 
noticed that our PHP code was setting the following headers for a zip file:


$headers = array('Content-Type: application/zip',
>                  'Content-Encoding: identity',
>                  'Content-Length: ' . filesize($theFile),
>                  'Cache-Control: store',
>                  'Content-Disposition: attachment; filename=' . 
> basename($theFile));
>



If I remove the Content-Encoding header I can fetch the file with Google 
App Engine. This header only seems to affect Zip or Gzip files. It does not 
seem to matter if it is present or not for text files.

Anyone know why the Content-Encoding header was causing the above exception?

Thanks,
Hamish


-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/hC9LEvpgp3oJ.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to