NSURLErrorDomain error -3001

拥有回忆 提交于 2019-12-24 15:48:10

问题


I'm trying to download a file from the internet, but I get the error -3001 back. I've been searching through google but the error doesn't appear on any website, so i have no idea what it means.

Can anyone tell me what the error code "NSURLErrorDomain error -3001" means?

Thanks


回答1:


I wrote an applescript awhile back that can search the header files for error codes. You can find the applescript here.

I ran that applescript for your error code and got this from the CFNetworkError.h file.

Error Description: kCFURLErrorCannotOpenFile




回答2:


There's also a full list of all NSURL error codes here. It's very handy when you get cryptic error messages from the URL loading system.




回答3:


The error comes from the fact that setDestination expects a full path with a filename:

This is wrong:

[fileDl setDestination:@"/Users/ant/ebooks/" allowOverwrite:YES];

This is right:

[fileDl setDestination:@"/Users/ant/ebooks/file.epub" allowOverwrite:YES];

So the explanation is that probably you did something like I did: specify an existing folder where you intended to put the data.

PS: the dash before 3001 prevents Google from returning any results with the request: "NSURLErrorDomain error -3001", it is parsed as: "NSURLErrorDomain and error and not 3001"..



来源:https://stackoverflow.com/questions/2943683/nsurlerrordomain-error-3001

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!