I would recommend that you use Package#to_stream in this case. It will give you the IO object that you can then read into the upload call.
The alternative is to write it to disk with Package#serialize, and then read it from the file system.
I am not familiar with the dropbox_client, but I would be surprised if it did not handle an IO stream correctly.
Best
-randym