Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DropboxSDK: error making request to /1/files/sandbox/- (516) (Dropbox V2) #69

Closed
MariamNers opened this issue Mar 31, 2016 · 4 comments
Closed

Comments

@MariamNers
Copy link

I have a weird error, its weird because my app works perfectly on a simulator but not on the actual iPad. I am speculating here that the issue is with Dropbox requests but please correct me if i am wrong. I am trying to download a file from my folder, so after my log in, i am presented with files in that folder that should be able to download with double tap. Now I get this error :

[WARNING] DropboxSDK: error making request to /1/files/sandbox/enumrec.pdf - (516) Error Domain=NSCocoaErrorDomain Code=516 "The file couldn’t be saved because a file with the same name already exists." UserInfo={path=/enumrec.pdf, destinationPath=/var/mobile/Containers/Data/Application/29A8C8C7-63F4-4EA0-82AB-846DE72C9859/Documents}

Although this is a brand new file that has never been downloaded!
Any idea how to resolve this issue?

@varenc
Copy link
Contributor

varenc commented Mar 31, 2016

It seems like you're using the older Obj-C SDK that works with API v1. This project is for the SwiftyDropbox SDK that supports API v2 from Swift. Closing this comment since this doesn't belong here.

To answer your question...it sounds like this error is about download to the path on the local device? It looks like your destination path is /var/mobile/Containers/Data/Application/29A8C8C7-63F4-4EA0-82AB-846DE72C9859/Documents. I suspect "Documents" is a pre-existing folder so I think you're trying to overwrite your Documents folder with the enumrec.pdf file and getting an error. You probably need to update your destination path to something like "/var/mobile/Containers/Data/Application/29A8C8C7-63F4-4EA0-82AB-846DE72C9859/Documents/enumrec.pdf".

If you continue to have problems please follow these Dropbox support channels: https://www.dropbox.com/developers/support

@varenc varenc closed this as completed Mar 31, 2016
@MariamNers
Copy link
Author

Thank you for your reply, the thing is I use this path :

let documentsDirectoryPath = NSSearchPathForDirectoriesInDomains
(.DocumentDirectory, .UserDomainMask, true)[0] as NSString
print("The file (metadata.filename) was downloaded.
Content type: (contentType). The path to it is : (documentsDirectoryPath)" )

And here is where i retrieve the file in another controller :

let documentsDirectoryPath = NSSearchPathForDirectoriesInDomains
(.DocumentDirectory, .UserDomainMask, true)[0] as NSString

Is this not a correct way to handle downloaded files? And yes, I will follow those support channels for future issues.

@varenc
Copy link
Contributor

varenc commented Mar 31, 2016

sorry, please follow up with the official support channels for this! They'll be more helpful on this than I can be :-)

@greg-db
Copy link
Contributor

greg-db commented Mar 31, 2016

[Cross-linking for reference: https://stackoverflow.com/questions/36344171/nscocoaerrordomain-code-516-the-file-couldn-t-be-saved-because-a-file-with-the and https://www.dropboxforum.com/hc/en-us/community/posts/205231193-DropboxSDK-error-making-request-to-1-files-sandbox-516-Dropbox-V2-]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants