I am working on an android project and am trying to add drop box functionality. I've got it all pretty much working, I can successfully upload and download files without any problems but if I upload a file that already exists, I need it to be replaced, at the moment it will just add a number on the end.
For example, I am uploading a file called MyFile.txt. If I try and upload this file again, instead of the file being replaced it will upload it as MyFile(1).txt and the next time MyFile(2).txt and so on.
Below is the code I am using in order to upload the file.
File file = new File(Environment.getExternalStorageDirectory() + "/MyApp/dropbox_sync.xml");
FileInputStream inputStream = new FileInputStream(file);
Entry newEntry = mDBApi.putFile("android_sync.xml", inputStream, file.length(), null, null);
How can I replace this file for each upload, or do I have to use the API to delete the file and then perform the upload. Thanks for any help you can provide.