开发者

NSURLErrorDomain error -3001

开发者 https://www.devze.com 2023-01-01 09:59 出处:网络
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 w

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


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.


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


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"..

0

精彩评论

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