Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
dougnull
3 years agoExplorer | Level 4
how do I set my Swift Dropbox API .upload to overwrite
How do I make .upload overwrite the file if it's already in dropbox?
When my swift tries to upload an updated file, I get "API route" error if file already in dropbox.
I tried this:
let req...
- 3 years ago
[Cross-linking for reference: https://stackoverflow.com/questions/72060987/how-can-i-overwrite-a-file-using-dropbox-api-in-ios-swift#72060987 ]
The upload method takes a 'mode' parameter, for which the value should be a Files.WriteMode, like this:
client.files.upload(path: dropbox_upload_pathname, mode: Files.WriteMode.overwrite, input: fileData) .response { response, error in if let response = response { print(response) } else if let error = error { print(error) } }For reference, you can use "overwrite", but "update" is recommended, as it's safer.
Greg-DB
Dropbox Community Moderator
3 years ago[Cross-linking for reference: https://stackoverflow.com/questions/72060987/how-can-i-overwrite-a-file-using-dropbox-api-in-ios-swift#72060987 ]
The upload method takes a 'mode' parameter, for which the value should be a Files.WriteMode, like this:
client.files.upload(path: dropbox_upload_pathname, mode: Files.WriteMode.overwrite, input: fileData)
.response { response, error in
if let response = response {
print(response)
} else if let error = error {
print(error)
}
}
For reference, you can use "overwrite", but "update" is recommended, as it's safer.
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!