File Transfer: is there a way to disable gzip feature?

64 views
Skip to first unread message

Kurt

unread,
Jan 8, 2013, 12:33:16 PM1/8/13
to phon...@googlegroups.com
Hi,

I am trying to use the File Transfer class in PG.  My "cloud server" is expecting the size to be what the file size is.
But it seems like gzip is adding some extra bytes when I do the transfer, so the size is always 100+ bytes longer and it fails since it keeps writing to the stream.

Is there a way to disable gzip and just upload the raw bytes. 
For example, I have a photo that is 2731289 but FileTransfer is sending 2731416 bytes (nearly 130 bytes extra).

The good news is that the upload works all the way to the 2731289 byte but then my server/cloud throws an error (null ptr).  I don't have control off the server/cloud API.

Any thoughts?
Thanks,
Kurt

Kurt

unread,
Jan 8, 2013, 10:20:43 PM1/8/13
to phon...@googlegroups.com
Ok,

I'm still working through this issue - but I think I figured out one part.
If the Accept-Encoding is blank, it defaults to gzip.  So I simply set the Header with a Accept-Encoding of blank ("") and it no long is using gzip.

But the size of the transfer is still more than the actual file size (by 127 bytes).  Seems like it adds extra info, like the filename, and mimetype.  So my server expects 127 less bytes...
Bad news is that my server/cloud is throwing a Null Ptr - but I don't know the root cause as I don't have access to that code...

One hour to code and 16 hours+ to figure out why it doesn't work.  :-) 

Shazron

unread,
Mar 21, 2013, 12:08:24 PM3/21/13
to phonegap
Kurt's workaround seems workable (guys, you should file an issue at https://issues.apache.org/jira/browse/CB so we can track/fix this)
There's another issue with gzip: https://issues.apache.org/jira/browse/CB-1518


On Wed, Mar 20, 2013 at 1:07 PM, Alex Wilhelm <alex.wi...@gmail.com> wrote:
Hi, I'm running into the same issue. Were you able to find a solution?

Any help would be greatly appreciated!

thanks

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages