Closed ntippie closed 6 years ago
That's interesting, thanks for your report.
I can't look into it with detail right now but will try to reproduce it this week.
I'm a bit confused, I think you're passing the path to the local file rather than the file contents, as the method expects. This is documented here: http://www.xuuso.com/dropbox_api/DropboxApi/Client.html#upload-instance_method
What's the value of save_path
in your first example?
If you pass the path to a file, this'll be saved in Dropbox as the content of your file.
I'm sorry, I documented it incorrectly. I've updated the original post.
I see now, thanks for your report!
I'll release a new version including this fix as soon as I get a chance, over the next few days.
I noticed that when the
#upload
method is given a string (like the result ofIO.read
), the uploaded file is not the correct size.I compared the content of the two files and they are identical up until test1's premature end (it is missing the last 269 bytes).
I traced the issue to here. I believe the first priority method to call should be
#bytesize
, which will get the proper size in bytes. I'd be happy to submit a PR if you agree.