Push Zone Upload Instructions

  1. Open your preferred SFTP client, and use the following credentials:
    • HOSTNAME = ftp.zone.alias.netdna-cdn.com (example: ftp.foo.bar.netdna-cdn.com)
    • USERNAME = zone.alias (example: foo.bar)
    • PORT = 22
  2. Navigate into the folder labeled public_html.
  3. Upload your files into this folder.

Important Note

For new file uploads, it can take up to 24 hours for your file to be accessible from all locations.

Custom upload scripts – short examples

  1. Python – using pysftp

    1. Install pysftp:

      $ sudo pip install pysftp
    2. Create upload script:

      # Example local file to upload
                      remote_file = 'test.txt'
                      srv = pysftp.Connection(host="ftp.ZONE.ALIAS.netdna-cdn.com", username="ZONE.ALIAS",
                      password="your_ftp_password")
                      srv.put(remote_file, '/public_html/' + remote_file)
                      srv.close()
                      
  2. Ruby – using net-sftp

    1. Install net-sftp:

      $ sudo gem install net-sftp
    2. Create upload script:

      require 'net/sftp'
                        Net::SFTP.start('ftp.ZONE.ALIAS.netdna-cdn.com', 'ZONE.ALIAS', :password => 'your_ftp_password') do |sftp|
                          sftp.upload!("test.txt", "/public_html/test.txt")
                      end
                      
  3. PHP – using sudo libssh2-php

    1. Install libssh2-php:

      $ sudo apt-get install libssh2-php
    2. Create upload script:

      <?php
                      $server = 'ftp.ZONE.ALIAS.netdna-cdn.com';
                      $port = '22';
                      $username = 'ZONE.ALIAS';
                      $passwd = 'your_ftp_password';
                      $connection = ssh2_connect($server, $port);
                      if (ssh2_auth_password($connection, $username, $passwd)) {
                      $sftp = ssh2_sftp($connection);
                      echo "Connection status: OK. Uploading file!"."n";
                      $file = 'test.txt';
                      $contents = file_get_contents($file);
                      file_put_contents("ssh2.sftp://{$sftp}/public_html/{$file}", $contents);
                      } else {
                      echo "Nope! Can not connect to server!"."n";
                      }
                      ?>