This article will serve as a walkthrough to connect to a VOD Zone and upload files from the MaxCDN portal.
To upload files to a VOD Zone, please follow these steps:
Upload Instructions
- Use FTP port 21 or SFTP port 22 from any upload program.
- For new video uploads, it can take up to 1 hour for your video to be viewable from all locations.
- HOSTNAME = ftp.ZONENAME.ALIAS.netdna-cdn.com
USERNAME = ZONENAME.ALIAS - VOD Zone files can be directly downloaded or streamed through RTMP, RTMPT or RTSP.
RTMP (Over port 1935) or RTMPT Setup (Over port 80).
URL = url: 'vod/ZONENAME.ALIAS/filename'
netConnectionUrl: 'rtmp://r.ZONENAME.ALIAS.netdna-cdn.com/play'
RTSP Setup.
URL = url: 'rtsp://d.ZONENAME.ALIAS.netdna-cdn.com/play/_definst_/vod/ZONENAME.ALIAS/filename'
iPhone Streaming.
http://d.ZONENAME.ALIAS.netdna-cdn.com/play/_definst_/vod/ZONENAME.ALIAS/filename/playlist.m3u8
PSEUDO Streaming.
clip: { url: 'http://p.ZONENAME.ALIAS.netdna-cdn.com/vod/ZONENAME.ALIAS/filename', provider: 'lighttpd' }
For RTMP(T,TE) and iPhone streaming if filename = an mp4 variant then add "mp4:" before "vod" in path name.
Custom Upload Scripts
Python - using pysftp
- Install pysftp:
$ sudo pip install pysftp
- 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) srv.close()
Ruby - using net-sftp
- Install net-sftp:
$ sudo gem install net-sftp
- 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", "/test.txt") end
PHP - using sudo libssh2-php
- Install libssh2-php:
$ sudo apt-get install libssh2-php
- 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}/{$file}", $contents); } else { echo "Nope! Can not connect to server!"."n"; } ?>
As always, If you have any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support - we are available 24/7 by chat or email.