Goople Drive upload fails when uploading a different file with the same name after deleting the file

Delphi 12 with latest TMS FNC Cloud Pack (and also previous version of TMS FNC Cloud Pack)
TMSFNCCloudStorageServices component.

My project checks to see if a file exists with the same name in Google Drive.
If it does, the cloud file is deleted and then the local file is updated. This works if the local file and cloud file are identical.

This fails if the local file is different from the cloud file. The cloud file is successfully deleted, and then the upload finishes with ARequestResult.Success = True even though the file does not appear in Google Drive.

Sender: TObject; const ACloudFile: TTMSFNCCloudFile;
const ARequestResult: TTMSFNCCloudBaseRequestResult);

Can you test for this without my having to create yet another test project?

We are not aware of any issues with resumable uploads to Google Drive.
Can you please check the contents of the ARequestResult.ResultString?
As http request actions are asynchronous, can you please make sure the delete action is fully finished (by using the OnDeleteItem event) before starting the upload?

Note: to receive a timely answer to your question, please make sure to post in the appropriate category or use the contact form on our website.

1 Like

Well, now you are aware of the issue. :slight_smile:

Yes, the call to upload the file is made in the OnDeleteItem() method to be sure that it is deleted.

The TMS web page forced(!) my selection of DEV and REST for this topic and would not search for any other tags like it usually does.

The button to add a new topic in the appropriate area (TMS FNC Cloud Pack) is greyed out.

If you want to reproduce this issue, your code must upload the file successfully. Then you must edit the file but keep it the same size in bytes. Then upload it again after deleting the matching file.

The ARequestResult.ResultString is similar in the case where A)the upload succeeds and B)when it fails, immediately after deleting a file having the same name and same file size:

'{'#$A' "kind": "drive#file",'#$A' "id": "1XGPxCf7hKR7CxNf-aU4luvXqoGu7WiHY",'#$A' "name": "Cloud TEST 1.4MD",'#$A' "mimeType": "application/octet-stream"'#$A'}'#$A

'{'#$A' "kind": "drive#file",'#$A' "id": "1AmqgaEFDXkej512AMH8YkvGO3wSPH4uB",'#$A' "name": "Cloud TEST 1.4MD",'#$A' "mimeType": "application/octet-stream"'#$A'}'#$A

I have not been able to reproduce this issue.
Can you please provide a ready to run sample project that demonstrates the issue so I can further investigate this?

Please note that the Support Center only allows users to post in product categories for which they have an active license. The REST Insight category is an exception as this is a free tool.