1 Apabila memuat naik fail ke ftp menggunakan pustaka pihak ketiga, ralat sentiasa dilaporkan
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];
Jumlah ralat output: domain = 1, ralat = 49, errorMessage = Tidak diketahuiAntaranya, domain=1 ialah:
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> */
};
ralat=49 ialah: #define EADDRNOTAVAIL 49 /Tidak dapat memberikan alamat yang diminta /
Fail setempat yang akan dimuat naik ialah: @"/var/mobile/Containers/Data/Application/2C632403-AC9C-4250-8E43-0CC0EAC14272/Library/Caches/CrashLog/iPhone_1.0.0.0_udid_2314.Adakah terdapat masalah dengan laluan ftp apabila ralat ini berlaku?
ringa_lee