[英]DBRequest#connectionDidFinishLoading: error moving temp file to desired location: The operation couldn’t be completed. (Cocoa error 4.)
我在我的项目中使用Dropbox api,当我深入某个目录,然后从该文件夹下载文件到iPhone时,我收到此错误。
I don't think you're handling this issue correctly. 我认为你没有正确处理这个问题。 The reason removing the folder path fixed it is because the error was being caused when there wasn't a folder created for the file to be moved to. 删除修复它的文件夹路径的原因是因为没有为要移动的文件创建文件夹时导致错误。 You removed the local path so all files are saved in the root folder but that will cause issues if files from different folders have the same name. 您删除了本地路径,因此所有文件都保存在根文件夹中,但如果来自不同文件夹的文件具有相同名称,则会导致问题。 You should be creating local folders before trying the loadFiles into them. 您应该在尝试将loadFiles放入其中之前创建本地文件夹。
In my case this error came when there was a folder name in the path where I have to save downloaded data but inside system I hadn't created it. 在我的情况下,当路径中有一个文件夹名称,我必须保存下载的数据,但在系统内部我没有创建它时,会出现此错误。 like if I pass local path as user/cloudDataFile/myimage.png but inside system there is not any folder named as cloudDataFile. 就像我将本地路径作为user / cloudDataFile / myimage.png传递,但在系统内部没有任何名为cloudDataFile的文件夹。 here myimage.png is image you want from dropbox. 这里myimage.png是你想要的图片来自dropbox。
Thanks. 谢谢。
This line is causing this problem. 这条线导致了这个问题。
[client loadFile:remoteFilePath intoPath:localFilePath];
I have localFilePath
with something like "/documents/X/Y/Z.pdf"
which i have changed to "/document/Z.pdf". 我有localFilePath
其中包含"/documents/X/Y/Z.pdf"
,我已将其更改为“/document/Z.pdf”。 This Solve my problem. 这解决了我的问题。 Thanks 谢谢
我找到了解决方案,您所要做的就是从路径组件中删除文件夹名称,它应该是一个简单的文件名,在目标路径功能中具有扩展名,
[client loadFile:newPath intoPath:localpath];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.