Uploading 10GB+ Files with the Rediafile API

A complete walkthrough of multipart streaming uploads for very large files, including chunking strategies and error recovery.

Uploading 10GB+ Files

The Rediafile Cloud API supports direct file uploads up to 10 GB per file using multipart/form-data.

Getting Started

First, authenticate to obtain a Bearer token:

curl -X POST https://rediafile.com/cloud/api/v2/authorize \
  -d "username=admin" -d "password=secret"

Streaming the Upload

For large files, use PHP's CURLFile class which streams the file from disk without loading it entirely into memory:

$ch = curl_init('https://rediafile.com/cloud/api/v2/file/upload');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'file' => new CURLFile('/path/to/large-file.zip'),
]);

Tuning php.ini

Ensure your server allows large uploads:

  • upload_max_filesize = 10240M
  • post_max_size = 10240M
  • max_execution_time = 3600

Error Handling

Always check the response status. A 429 means you should retry with exponential backoff.

Edit article