Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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 request = client!.files.upload( path: dropbox_upload_pathname, input: fileData, WriteMode: overwrite )
..but got error "Cannot find 'overwrite' in scope."
I tried these but get build errors...
client!.files.upload( path: dropbox_upload_pathname, WriteMode: overwrite, input: fileData)
client!.files.upload( path: dropbox_upload_pathname, input: fileData, WriteMode: overwrite)
[Cross-linking for reference: https://stackoverflow.com/questions/72060987/how-can-i-overwrite-a-file-using-dropbox-api-in-ios-swi... ]
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.
[Cross-linking for reference: https://stackoverflow.com/questions/72060987/how-can-i-overwrite-a-file-using-dropbox-api-in-ios-swi... ]
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.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!