cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Upload pdf(using swift sdk) is damaged when downloading from dropbox

Upload pdf(using swift sdk) is damaged when downloading from dropbox

hzy916
Explorer | Level 3

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.Screen Shot 2018-06-14 at 14.26.57.png 

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. 

 Screen Shot 2018-06-18 at 14.06.03.png

Appreciate anyone's help! Thank you very much. I have been stuck for a long time

1 Reply 1

chirstius
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

 

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    chirstius Dropbox Staff
What do Dropbox user levels mean?