Upload API Documentation
You can quickly and easily upload files to your account via a very simply API. Just POST the data to the following URL.
http://upload.putlocker.com/uploadapi.php
Available Variables
| Variable Name |
Required |
Details |
| file |
Yes |
Contains the file you wish to upload, usually the full path on your server/computer. |
| user |
Yes |
Your username that you use to login to this site |
| password |
Yes |
Your password that you use to login to this site |
| convert |
No |
1 = make streaming, 0 = regular file |
| folder |
No |
Full folder name that you have created in your Control Panel |
Output
A message will be outputted, along with a link to your file if everything worked as it should.
| Output Variable |
Visible |
Details |
| <message></message> |
Always |
Will tell you if there are any problems with your request, or give the OK message |
| <link></link> |
On Success |
Will contain the link to your file if the upload was successful |
Sample Upload Script
This is a sample PHP upload script. Just plug in your username and password, and its ready to go.
// Variables to Post
$local_file = "/path/to/filename.avi";
$file_to_upload = array(
'file'=>'@'.$local_file,
'convert'=>'1',
'user'=>'YOUR_USERNAME',
'password'=>'YOUR_PASSWORD',
'folder'=>'FOLDER_NAME'
);
// Do Curl Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://upload.putlocker.com/uploadapi.php');
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $file_to_upload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result=curl_exec ($ch);
curl_close ($ch);
// Do Stuff with Results
echo $result;