Dropbox renames files

Hi,


could anyone explain me why Dropbox changes the name of the uploaded file if the file always exists?
In the last time the file was overwritten. Now the file get an additional number.

myFile.doc will be saved as myFile (1).doc
After the next upload the file will be renamed myFile (2).doc and so on.

I didn't change anything in the code:
AdvDropBox.Upload(NIL, localName); 

Btw: In your Cloud Storage access demo the callback URL of the AdvDropbox seems to be wrong.


If I want to connect to Dropbox I will get the Dropbox information:

Invalid redirect_uri. It must exactly match one of the redirect URIs you've pre-configured for your app (including the path).

What is the correct information?
  1. This is a default behavior of Dropbox when you perform an upload with item reference nil, i.e. new file when there is already a file with the same name. If you first retrieve the DropBox folder info and if this file exists, pass a reference to it as first parameter, that should help.
    2) The callback url configured via Advdropbox.App.CallBackURL must match exactly with the callback URL you specified in your Dropbox developer key settings.
1) This is a default behavior of Dropbox when you perform an upload with item reference nil, i.e. new file when there is already a file with the same name. 

Is it a new behavior of the Dropbox API V2? The last years it worked with item reference nil if I used the AdvDropBox Mode as dmSandbox.

If you first retrieve the DropBox folder info and if this file exists, pass a reference to it as first parameter, that should help.

It seems it will not work. If I use a cloudItem reference of the downloaded or existing file and use it at first parameter in AdvCustomDropBox.Upload() then the file will not be uploaded.
If I debug your CloudCustomDropBox upload function then I can see, that the Folder is assigned. 
And there the FolderName will be generated from TDropBoxItem(Folder).FullPath, but the FullPath has the name of the file and not the name of the folder.
Thats the reason why in UploadInt the efn variable has the value "/filename/filename".

Is it a bug or don't I understand the function call?

Best regards

And if I try to get the folder of the referenced file the ParentFolder of the cloud item will result NIL (maybe because of the Sandbox mode?)


AdvDropBox.Upload( (myCloudItem as TDropBoxItem).Parentfolder, localFileName);

Please note that the default behavior in DropBox API V2 when uploading a file with a filename that already exists is to rename the uploaded file.

Note that if the uploaded file is identical to the existing file, nothing will happen.

The API supports to change this behavior to automatically replace the previous file with the new file, but this is currently not yet possible in the TTMSFMXCloudDropBox component.
However, this is a good suggestion and we'll consider adding this functionality in a future version of the TMS FMX Cloud Pack.


However, this is a good suggestion and we'll consider adding this functionality in a future version of the TMS FMX Cloud Pack.

An method like AdvGDrive.Update() would be nice also for AdvDropbox.

At the mean tine I will call the method Delete() before I upload the newer version of a file.