Fetching binary data doesn't seem to work #9

Closed
evnm opened this Issue Mar 11, 2011 · 8 comments

3 participants

@evnm
Owner

Pulling down binary data (e.g. images) from Dropbox doesn't seem to be handled properly. When the blobs returned from getFile or getThumbnail are written to disk as jpg's, they are corrupted.

Looked into passing the strings returned from Dropbox into Buffers using binary encoding, but this didn't solve the problem outright.

@evnm
Owner

The root issue of this seems to be the fact that node-oauth defaults GETs to utf8.

@jtsao22

So, is there any solution available or will this require hacking into node-oauth?

@evnm
Owner

@ciaranj has been totally unresponsive on this, so I'm assuming it'll require node-oauth surgery.

@ciaranj

eh? tbh I hadn't noticed it as an issue on github!

@evnm
Owner

No worries. @ralphholzmann filed this issue a while back and then we kinda forgot about it.

@ciaranj

As a work around, instead of passing a callback function to to the node-oauth get , it will return a request object that you can configure whatever encoding you wish on when you add a response handler to it .. would that not help ?

@jtsao22

Thanks guys for responding so quickly! Claranj, that sounds great to me. I just tried dropbox-node w/the setEncoding('utf-8') changed to setEncoding('binary') and got a file that was not corrupted from dropbox, so for sure adding the request object to configure the encoding would be great.

@evnm
Owner

Closing this issue, as this library has long been deprecated.

@evnm evnm closed this Mar 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment