第三方LxFTPRequest FTP上传 总报错

1、采用第三方库上传文件到ftp时总报错
2、代码:

    static NSString * const FTP_ADDRESS = @"ftp://54.223.34.111:21/";
    static NSString * const USERNAME = @"123456";
    static NSString * const PASSWORD = @"123456";

    
    LxFTPRequest * request = [LxFTPRequest uploadRequest];
    request.serverURL = [[NSURL URLWithString:FTP_ADDRESS]URLByAppendingPathComponent:@"./test.txt"];
    request.localFileURL = [NSURL fileURLWithPath:fileName];
    request.username = USERNAME;
    request.password = PASSWORD;
    request.progressAction = ^(NSInteger totalSize, NSInteger finishedSize, CGFloat finishedPercent) {
        
    };
    request.successAction = ^(Class resultClass, id result) {
        NSLog(@"uploadbyftp success");
    };
    request.failAction = ^(CFStreamErrorDomain domain, NSInteger error, NSString * errorMessage) {
        NSLog(@"domain = %ld, error = %ld, errorMessage = %@", domain, error, errorMessage);    // domain = 1, error = 49, errorMessage = Unknown
    };
    [request start];

总输出错误:domain = 1, error = 49, errorMessage = Unknown
其中,domain=1为:

typedef CF_ENUM(CFIndex, CFStreamErrorDomain) {
    kCFStreamErrorDomainCustom = -1L,      /* custom to the kind of stream in question */
    kCFStreamErrorDomainPOSIX = 1,        /* POSIX errno; interpret using <sys/errno.h> */
    kCFStreamErrorDomainMacOSStatus      /* OSStatus type from Carbon APIs; interpret using <MacTypes.h> */
};

error=49为:#define EADDRNOTAVAIL 49 / Can't assign requested address /

本地待上传文件为:@"/var/mobile/Containers/Data/Application/2C632403-AC9C-4250-8E43-0CC0EAC14272/Library/Caches/CrashLog/iPhone_1.0.0.0_udid_20160523163703_4.plcrash

出现这种错误是ftp路径有问题,还是?

阅读 2.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏