开发者

DBRequest#connectionDidFinishLoading: error moving temp file to desired location: The operation couldn’t be completed. (Cocoa error 4.)

i am using Dropbox api in my project and i get this error w开发者_如何学JAVAhen i go deep into some directory and then download a file from that folder to 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.


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. here myimage.png is image you want from dropbox.

Thanks.


I found the solution, all you have to do is to remove the folder name from path component and it should be a simple file name with extension in destination path of function,

[client  loadFile:newPath intoPath:localpath];


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". This Solve my problem. Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜