We’re aware of an issue causing slower load times on the Dropbox Community forum. It should be resolved soon. Thanks for your patience!
Forum Discussion
hzy916
8 years agoExplorer | Level 3
Upload pdf(using swift sdk) is damaged when downloading from dropbox
I am following the instructions on https://github.com/dropbox/SwiftyDropbox#download-style-request
and I successfully upload my pdf to dropbox. However the uploaded pdf cannot be previewed and when I download, it shows the following error.
I tired to upload the same pdf manually to dropbox. I can preview and when I download it, it is completely correct.
This is how I upload my pdf using swift.
Appreciate anyone's help! Thank you very much. I have been stuck for a long time
1 Reply
- chirstius8 years ago
Dropbox Staff
Hello hzy916,
I think the issue here is that you're trying to encode the PDF file as if it were text data and not binary data.
Try creating a URL to the local file path and updating your request to point the 'input' parameter directly to that URL.
See if that works as expected.
-Chuck
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!