You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
datan3rd
6 years agoExplorer | Level 3
Upload SQLite Not a Database
I have been able to get the Dropbox SDK working for objective C. The problem I am running into is that when I upload my backup of a SQLite database it is no longer being recognized as a DB. After som...
datan3rd
Explorer | Level 3
UPDATE: good news is I was able to find some code that worked in uploading the file and the subsequent download and restore is now working.
New smaller issue:
I need to figure out the code to allow overwrite as if the backup already exists then it will fail on upload currently.
[[client.filesRoutes uploadUrl:@"/backups/Backup.sqlite" inputUrl:databasePath] setResponseBlock:^(DBFILESFileMetadata *metadata, DBFILESUploadError *uploadError, DBRequestError *error) { if (metadata) { NSLog(@"The upload completed successfully."); NSLog(@"File metadata:"); NSLog(@"%@", metadata); [self enableRestore]; } else if (uploadError) { NSLog(@"Something went wrong with the upload:"); NSLog(@"%@", uploadError); } else if (error) { NSLog(@"Something went wrong with the API call:"); NSLog(@"%@", error); } }];
Greg-DB
6 years agoDropbox Staff
I'm glad to hear you already sorted out the original issue.
To control overwriting, you should use this version of the uploadUrl method, which takes a 'mode' parameter. The 'mode' parameter accepts a DBFILESWriteMode object, which you can set to your desired write mode, such as "Overwrite". There's an example of that here.
- datan3rd6 years agoExplorer | Level 3
Greg - thanks as always for the reply. This code is where I started from. Using that code (uploadData) the SQLite file was not retaining itself as a DB. Switching to the code I have now with uploadUrl is functioning as expected with the exception of the overwrite issue. I will chose the overwrite issue and possibly just code around it if there is no alternative.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 18 hours agoIf 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 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!