hopeless/node-dbox — comment on commit 963e4da6d8d7aae73a72d272283470acc1907232
File:  line 0
By hopeless:

Thanks for this module by the way. I'd never have started without it. Does the patch work? A good question.

I was building UrlPipe as a toy project and needed to use the request module to download a file and then upload it to dropbox. But whatever I did, I couldn't get the encodings right when using buffers (and not really a good idea anyway for large files). So it made sense to access the request object and use it to .pipe my download straight to dropbox. This meant that request was managing the encodings and it all works fine. I have this working on my demo system for most files (up to a few MB) but it occasionally fails with a 411 error which is "Chunked encoding was attempted for this upload, but is not supported by Dropbox". I'm not sure why it works sometimes and not others though!

This was just a hack and it could probably be improved. Perhaps if no callback is passed into put() just return the request object instead of executing?

You can see where I'm using this function here: https://github.com/hopeless/UrlPipe/blob/master/process_downloads.js#L7