FTP Kit for iOS and OS X

FTP Kit for iOS and OS X

Released 4 years ago , Last update 4 years ago

A fast and easy-to-use Objective-C client library for connecting with FTP servers in iOS and OS X apps.

Easy-to-use FTP client library for iOS and OS X apps

Want to add FTP communication into your app, but don't want to bother with low level C APIs and raw network streams? Introducing FTP Kit, the solution for providing full featured FTP access in your apps with just a few lines of code.

Features at a glance:

  • Easy integration with a few lines of code
  • Clean and straight forward API
  • All networking stuff is done completely asynchronous
  • List remote directory content
  • Downloading of remote files from a FTP Server
  • Uploading of local files to a FTP Server
  • Create remote directories
  • Delete remote files
1.0
  • 5 0
  • 4 0
  • 3 0
  • 2 0
  • 1 1
1 Reviews Read Reviews

Pricing

14 day 14-day money-back guarantee

$49.99

Application License

  • Perpetual license

  • 1 application

  • Can distribute binary products only

  • Commercial use

  • 6 months support

How to use

1. Connect to FTP server

Create your FTP client instance:

// Create FTP location Object. We use nil as a path, so we are pointing to the root directory.
DZFTPLocation *ftpLocation = [DZFTPLocation locationWithHost:@"ftp://my.ftp-server.com" 
                                                        path:nil 
                                                    username:@"username" 
                                                    password:@"password"];
// Initialize client with location
DZFTPClient *ftpClient = [[DZFTPClient alloc] initWithLocation:ftpLocation];
// Register delegate
ftpClient.delegate = self;

2. Execute requests

List directory content at the path of our current FTP location:

DZFTPRequest *request = [ftpClient listDirectoryInCurrentLocationShowHiddenItems:YES];
// The requests starts immediately. Maybe you want to keep the request object for later use.

Recive directory content in delegate method:

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didListItems:(NSArray *)items
{
    // Do some stuff with received conent.
    for (DZFTPItem *item in items)
    {
        if (item.type == DZFTPItemTypeDirectory) //Directory
            // ...
        else if (item.type == DZFTPItemTypeFile) //File
            // ...
    }

    // Usually you will present the content in a TableView...
} 

Download a file from the FTP server:

DZFTPItem *item = // ...
NSString *downloadPath = [NSTemporaryDirectory() stringByAppendingPathComponent:item.name];
DZFTPRequest *request = [ftpClient downloadItem:item toDestination:downloadPath];
// The requests starts immediately. Maybe you want to keep the request object for later use.

Receive delegate notifications:

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didUpdateProgress:(float)progress
{
    // Update the UI, e.g. progressBar.value = progress
}

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didDownloadFile:(NSURL *)sourceURL toDestination:(NSString *)destinationPath
{
    // Download finished. Do some stuff with the file...
}

Upload a local file to the FTP server

NSString *lokalFilePath = @"my/lokal/file.txt";
DZFTPRequest *request = [ftpClient uploadFileToCurrentLocation:lokalFilePath];
// The requests starts immediately. Maybe you want to keep the request object for later use.

Receive delegate notifications:

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didUpdateProgress:(float)progress
{
    // Update the UI, e.g. progressBar.value = progress
}

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didUploadFile:(NSString *)sourcePath toDestination:(NSURL *)destinationURL
{
    // Upload finished. 
    // Do some stuff, e.g. relist content.
    [ftpClient listDirectoryInCurrentLocationShowHiddenItems:YES];
}

Create a new remote directoy

NSString *directoryName = @"My Directory";
DZFTPRequest *request = [ftpClient createDirectoryInCurrentLocation:directoryName];
// The requests starts immediately. Maybe you want to keep the request object for later use.

Receive delegate notification:

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didMakeDirectory:(NSURL *)directoryURL
{
    //Directory created.
    // Do some stuff, e.g. relist content.
    [ftpClient listDirectoryInCurrentLocationShowHiddenItems:YES];
}

Delete a file from the FTP Server

DZFTPItem *item = // ...
DZFTPRequest *request = [ftpClient deleteFileInCurrentLocation:item.name];
// The requests starts immediately. Maybe you want to keep the request object for later use.

Receive delegate notification:

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didDeleteFile:(NSURL *)fileURL
{
    //File deleted.
    // Do some stuff, e.g. relist content.
    [ftpClient listDirectoryInCurrentLocationShowHiddenItems:YES];
}

Cancel a running request

DZFTPRequest *request = // ...
[request cancel];

Receive delegate notification:

- (void)client:(DZFTPClient *)client requestDidCancel:(DZFTPRequest *)request
{
    // Request canceled. Do some stuff...
}

Listen to the current status of the running request

Running request notify the delegate of ftpClient when the status of the connection changes. You can register for a delegate method in order to listen to this changes. This may be helpful for logging purposes or for showing status informations in the UI.

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didUpdateStatus:(NSString *)status
{
    // Update connection status.
    // Do some stuff, e.g. update UI: statusLabel.text = status
}

Error handling

If an error occured during a request, your delegate will be notified:

- (void)client:(DZFTPClient *)client request:(DZFTPRequest *)request didFailWithError:(NSError *)error
{
    //Something went wrong. Maybe you want to notify the user.:    
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"Error %d", error.code]
                                                    message:[error localizedDescription]
                                                   delegate:nil
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:nil];
    [alert show];
}

Setup / Integration

Requirements

The source code of FTP Kit is developed on Xcode 5.0. FTP Kit works on a deployment target of iOS 4 or greater or OS X 10.6 or greater and can be used in ARC and non-ARC projects.

Required Frameworks:

  • Foundation
  • CFNetwork

If you link FTP Kit in your project as a static library, you will need to set the -ObjC and -all_load linker flags. For details have a look at the following instructions.

Integration

  1. Drag the "DZFTP.xcodeproj" into your project.
  2. Add the required library and frameworks as show in the screenshot below.
  3. Open the "Build Settings" tab of your target and add the following changes:
    • Other Linker Flags: -ObjC -all_load
  4. If you are using XCode prior 5.0 you will also need to add libDZFTP.a as a target dependency:
    • Open the "Build Phases" tab.
    • Expand the "Target Dependencies" section
    • Press "+" and select libDZFTP.a
  5. Add the #import <DZFTP/DZFTP.h> statement everywhere you want to use FTP Kit in your project.

2 licenses, starting from From » $49.99 View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


Or enter your name and Email
  • XG xavier gerber 4 years ago
    is it possible to try into my project with the demo version ? (with the installation instruction on the main page)
  • A Alex 4 years ago
    What protocol this framework supported? Only FTP or other too?
  • J James 4 years ago
    Does this library support FTPS or SFTP?