Note that there are some explanatory texts on larger screens.

plurals
  1. POUpload more than one file on FTP
    primarykey
    data
    text
    <p>i'm new to objective-c and iOS. I'm using SimpleFTPSample to make test app for uploading and downloading files to ftp. I need to upload two files on ftp, but in SimpleFTPSample you could upload only one... so what do i need add to source code? I guess there must be some loop, but i don't know where... </p> <p>Here's my code, i add for() but i know that is wrong, but i do not have any ideas. Thanks for any help.</p> <pre><code>success = (url != nil); NSMutableArray *listFile = [[NSMutableArray alloc] initWithCapacity:2]; [listFile addObject:[[[NSBundle mainBundle]resourcePath]stringByAppendingPathComponent:@"1.txt"]]; [listFile addObject:[[[NSBundle mainBundle]resourcePath]stringByAppendingPathComponent:@"2.txt"]]; for (int i= 0; i &lt;= 1; i++ ) { self.filePath = [listFile objectAtIndex:i]; url = [NSURL URLWithString:@"ftp://anonymous@ftp"]; url = CFBridgingRelease( CFURLCreateCopyAppendingPathComponent(NULL, (__bridge CFURLRef) url, (__bridge CFStringRef) [self.filePath lastPathComponent], false)); // ); success = (url != nil); self.ftpFileStream = [NSInputStream inputStreamWithFileAtPath:_filePath]; assert(self.ftpFileStream != nil); [self.ftpFileStream open]; self.ftpNetworkStream = CFBridgingRelease( CFWriteStreamCreateWithFTPURL(NULL, (__bridge CFURLRef) url) ); assert(self.ftpNetworkStream != nil); self.ftpNetworkStream.delegate = self; [self.ftpNetworkStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; [self.ftpNetworkStream open]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload