Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Dropbox upload : the old file remains

 Post Reply Post Reply
Author
Csillag Zsolt View Drop Down
Member
Member
Avatar

Joined: 16 Oct 2017
Posts: 52
Post Options Post Options   Quote Csillag Zsolt Quote  Post ReplyReply Direct Link To This Post Topic: Dropbox upload : the old file remains
    Posted: 12 Sep 2019 at 3:35pm
Hello,

I use the following code to upload files in Dropbox.
The problem is that the user wants to backup the same files every day.

About half a year ago Dropbox renamed the old files on it own, but now we noticed if there is no file in the destination directory, the new file is uploaded, but if there is a previous version (with the same name), the Dropbox doesn't do anything (in other words the old file remains).
It seems to me that the Dropbox behaviour changed.

How can I modify my code so as it will always upload the new file and the old file would also remain there? Thank you!

var
 nci: TTMSFMXCloudItem;
 di : TDropBoxItem;
Begin
  ProgressBar.Value := 0;
  ProgressBar.Visible := true;
  IsUploading         := true;

  di := TDropBoxItem.Create(nil);
  di.Path := sFelhosKonyvtar;


  nci := Storage.Upload(di, sAllomany );
  ProgressBar.Visible := false;
  IsUploading         := true;

  if Assigned(nci) then
    CloudTreeViewAdapter.InitTreeView;
End;
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2049
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 12 Sep 2019 at 4:16pm
Hi,

Can you please make sure the UploadMode property is set to umOverwrite?
Back to Top
Csillag Zsolt View Drop Down
Member
Member
Avatar

Joined: 16 Oct 2017
Posts: 52
Post Options Post Options   Quote Csillag Zsolt Quote  Post ReplyReply Direct Link To This Post Posted: 13 Sep 2019 at 1:18pm
Hi Bart,

Thank you for the answer.

I set UploadMode property to umOverwrite, I uploaded the same file to Dropbox and after refreshing the Dropbox it still shows: "Modified yesterday at 2:18 pm"

... but please note that if I upload the same file manually (without my program) using simple Drag and Drop, the Dropbox doesn't overwrite the old file with the new file...
So it seems that the problem might not be with your component but with Dropbox itself ...

Thank you!

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down