question

Ian X. Martins avatar image
Ian X. Martins asked

file upload fails with Node Already Exists message

I am getting the following error when attempting to upload a file to a folder, where another file with the same name had been deleted. to be clear, here are the steps to reproduce: 1. create folder 2. upload file to folder 3. delete file 4. upload same file to same folder it will fail with this message: "Node with the name {filename} already exists under parentId {folder id} conflicting NodeId: {deleted file id}" if I make a request for all nodes (/drive/v1/nodes/) the deleted file will show up in the list of results, but it's parents will be []. if I get the list of children of the folder in which I want to upload the file (/drive/v1/nodes/{folder id}/children/), it will return []. since the deleted file isn't in the folder, what is preventing me from putting another file in the folder?
amazon drive
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sean Callahan avatar image
Sean Callahan answered
Thank you for your post. In our current name conflict check, we don’t consider a trashed file. Trashed files only show up in listTrash operation, not listNodes. Can you please try again to see if this is just a transient bug? If you still experience this error please send us an email to clouddrive-api-support@amazon.com. In the email, please include the customerId/nodeId having this issue.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Craig-Wood avatar image
Nick Craig-Wood answered
I've found this problem too. What happens is that the file's status changes to "PURGED" and it sticks around in the directory for a short time after that. I found that a 1 second sleep was enough for it to disappear from the directory listing. Alternatively if you are just overwriting a file then you can use PUT : { {contentUrl}}/nodes/{id}/content instead of a delete then re-upload.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, I've passed your feedback on to the team and it has been noted as a feature request. Thanks! Regards, Jamie
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.