FTP上的上载文件在iOS中不起作用

FTP上的上载文件在iOS中不起作用,ios,objective-c,ftp,xcode5,Ios,Objective C,Ftp,Xcode5,我用这个在FTP上上传文件 我正在使用此方法进行上载 - upload { //the upload request needs the input data to be NSData //so we first convert the image to NSData UIImage * ourImage = [UIImage imageNamed:@"space.jpg"]; NSData * ourImageData = UIImageJPEGRepr

我用这个在FTP上上传文件

我正在使用此方法进行上载

  - upload
{

    //the upload request needs the input data to be NSData 
    //so we first convert the image to NSData
    UIImage * ourImage = [UIImage imageNamed:@"space.jpg"];
    NSData * ourImageData = UIImageJPEGRepresentation(ourImage, 100);


    //we create the upload request
    //we don't autorelease the object so that it will be around when the callback gets called
    //this is not a good practice, in real life development you should use a retain property to store a reference to the request
    WRRequestUpload * uploadImage = [[WRRequestUpload alloc] init];
    uploadImage.delegate = self;

    //for anonymous login just leave the username and password nil
    uploadImage.hostname = @"xxx.xxx.xxx.xxx";
    uploadImage.username = @"myuser";
    uploadImage.password = @"mypass";

    //we set our data
    uploadImage.sentData = ourImageData;

    //the path needs to be absolute to the FTP root folder.
    //full URL would be ftp://xxx.xxx.xxx.xxx/space.jpg
    uploadImage.path = @"/space.jpg";

    //we start the request
    [uploadImage start];

}

-(void) requestCompleted:(WRRequest *) request{

    //called if 'request' is completed successfully
    NSLog(@"%@ completed!", request);

}

-(void) requestFailed:(WRRequest *) request{

    //called after 'request' ends in error
    //we can print the error message
    NSLog(@"%@", request.error.message);

}

-(BOOL) shouldOverwriteFileWithRequest:(WRRequest *)request {

    //if the file (ftp://xxx.xxx.xxx.xxx/space.jpg) is already on the FTP server,the delegate is asked if the file should be overwritten 
    //'request' is the request that intended to create the file
    return YES;

}
但我没有成功地上传文件的FTP。 我也没有得到任何错误


那么,如何在FTP上上传文件呢?

我们需要的不仅仅是这个……我也面临同样的问题。