简体   繁体   English

DBRequest#connectionDidFinishLoading:将临时文件移动到所需位置时出错:无法完成操作。 (可可错误4.)

[英]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.

相关问题 该操作无法完成。 (可可错误1560.) - The operation couldn’t be completed. (Cocoa error 1560.) “这项行动无法完成。 (可可错误512.)“ - “The operation couldn’t be completed. (Cocoa error 512.)” 该操作无法完成。 (MKErrorDomain错误4) - The operation couldn’t be completed. (MKErrorDomain error 4) 无法保存到数据存储:无法完成操作。 (可可错误133020.) - Failed to save to data store: The operation couldn’t be completed. (Cocoa error 133020.) 位置管理器错误:操作无法完成。 (kCLErrorDomain错误0。) - Location Manger Error: The operation couldn’t be completed. (kCLErrorDomain error 0.) 该操作无法完成。 (可可错误512.)Coredata Iphone。 没有文件可以复制到文档文件夹中 - The operation couldn’t be completed. (Cocoa error 512.) Coredata Iphone. No files can be copied in documents folder 该操作无法完成。 不允许操作 - The operation couldn’t be completed. Operation not permitted didFailWithError:错误域= kCLErrorDomain代码= 0“无法完成操作。 (kCLErrorDomain错误0。)“ - didFailWithError: Error Domain=kCLErrorDomain Code=0 “The operation couldn’t be completed. (kCLErrorDomain error 0.)” Xcode 4共享IPA“操作无法完成。 没有相应的文件和目录” - Xcode 4 share IPA “The operation couldn’t be completed. No such file or directory” iOS 5.0 AVAudioPlayer加载音频片段时出错:无法完成该操作。 (OSStatus错误-50。) - iOS 5.0 AVAudioPlayer Error loading audio clip: The operation couldn’t be completed. (OSStatus error -50.)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM