You have storage at BlazingCDN. You want to upload the selected file to a public directory on a CDN. To integrate, you need to find the following items:
- Server host name – xyz.com
- Username – XYZ
- Password – XXX
- FTP – ZZZ
Then enter the code below:
<? php
$ ftp_server = “xyz.com”;
$ ftp_user_name = “XYZ”;
$ ftp_user_pass = “XXX”;
$ file = “sample.file.name”;
$ remote_file = “public / sample.file.name”;
// set up basic connection
$ conn_id = ftp_connect ($ ftp_server);
// login with username and password
$ login_result = ftp_login ($ conn_id, $ ftp_user_name, $ ftp_user_pass);
// upload a file
if (ftp_put ($ conn_id, $ remote_file, $ file, FTP_ASCII)){
echo “successfully uploaded $ file \ n”;
exit;
}
else
{
echo “There was a problem while uploading $ file \ n”;
exit;
}
// close the connection
ftp_close ($ conn_id);
?>
See also:
BlazingCDN – upgrade your storage
BlazingCDN – Storage API documentation
BlazingCDN – logs storage
BlazingCDN – custom HTTP headers
BlazingCDN – Create a storage
BlazingCDN – access to storage
BlazingCDN – backups