Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
gmacerola
4 years agoExplorer | Level 3
Empty files on upload
I have seen that this issue has been presented a few times before however, those solutions haven't helped in completed this last task for my app. I am using React Native with Expo. I am using Im...
Greg-DB
Dropbox Community Moderator
4 years ago[Cross-linking for reference: https://stackoverflow.com/questions/66862389/image-upload-to-dropbox-api-from-ios-sends-corrupted-file-to-dropbox ]
The /2/files/upload endpoint is a "content-upload" style endpoint, meaning that it requires the file data to be uploaded in the request body. I see you're attempting to set the file data as such by using the "body" parameter in your "requestOptions" that you pass to "fetch".
That seems correct, but you'll need to make sure your "file" variable contains the actual file data you want to upload.
I understand you currently just have the URL for local file data though; not the file data itself. You'll need to read the data from the local filesystem in order to pass the data along. I'm afraid I can't offer much guidance on doing so though as that's not related to the Dropbox API itself. You may need to refer to the relevant iOS documentation from Apple (or otherwise React/Expo if they offer functionality for this).
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!