Storage & FTP Upload
Keep the videos on FTP, SFTP, Amazon S3, Backblaze B2, Wasabi, Cloudflare R2, Spaces or Google Drive, move them between stores, and let members upload big files by FTP.
A video site fills a web host quickly. This free plugin keeps the files where there is room - an FTP or SFTP server, a bucket on Amazon S3 or a store that speaks its language (Backblaze B2, Wasabi, Cloudflare R2, DigitalOcean Spaces, MinIO), Google Drive or a second disk - and plays them from there. Its second part, Upload by FTP, gives members an FTP account of their own for files too big or too many for a browser.
Until AIO Video 1.18 the FTP file server lived in Media & FFmpeg. Since 1.19.0 it is here; a site that used it finds the plugin switched on after the update with the same settings, and nothing changes for its files.
Switching it on
Admin → Plugins → Storage & FTP Upload → Switch on. It makes three tables (aio_storage_files, aio_storage_ftp_users, aio_storage_imports) and adds Storage, Files & moves and Upload by FTP under Plugins in the menu. Nothing moves until you choose a store: with This server every file stays in uploads/, as without the plugin.
Choosing where the files go
Admin → Storage shows where the files are now and offers six stores as cards. Pick one, fill in its settings, press Save and test. The test connects, sends a small file, reads its size back, fetches it again, opens it at its web address and deletes it - each step is reported.
| Store | What it asks for | Good to know |
|---|---|---|
| This server | nothing | The default. |
| FTP or FTPS server | address, port, username, password, folder on that server, web address of that folder, timeout, passive mode, secure (FTPS) | The file server of the old Media page. Needs PHP's ftp extension. |
| SFTP server (SSH) | address, port, username, password or a private key, folder, web address | The SSH code comes with the plugin (phpseclib 3, MIT licence): no extension to install. A key may be OpenSSH, PEM or PuTTY; the password opens it if it has one. |
| Amazon S3 or S3-compatible | which store, bucket, region, account ID (R2 only), endpoint (another S3 store only), access key ID, secret, folder in the bucket, public address, signed-link minutes, address style | Signed with AWS Signature Version 4, no SDK. Files over 64 MB go up in 16 MB parts. Without a public address each file gets a signed link (the bucket can stay private). |
| Google Drive | your own OAuth client ID and secret, folder name, play-link minutes | See below. |
| Another disk on this server | a full folder path, its web address | A second disk or a volume mounted on a VPS. |
An empty password or secret box keeps the one already saved. Secrets are kept sealed (AES-256-GCM) and never printed into the page.
How files are served (every store):
- When a file is in both places - Play from the storage, or Play this server's copy while there is one.
- Folders to send - comma separated;
uploads/holds videos, sizes, pictures and avatars. - Keep a copy here too - off deletes the file here once it is safely on the storage, which is what frees the disk. With it off, later re-encoding (Convert again, a new size) has no original to work from.
A video's original stays here until every size is made, then goes across with them. A file the store does not take (away, full) plays from here and is sent again by the job File server, second tries every ten minutes.
Cloudflare R2, Backblaze B2, Wasabi, Spaces
Choose the store in Which store; the endpoint is made from the region (and, for R2, the account ID). For R2 the region is auto. Give the key only what the site needs on that bucket: put, get, delete and list (on S3: s3:PutObject, s3:GetObject, s3:DeleteObject, s3:AbortMultipartUpload). R2 charges nothing for what goes out, which makes it the cheapest way to serve video: give the bucket a custom domain and put it in Public address of the bucket.
Google Drive
- At console.cloud.google.com make a project, enable the Google Drive API, set up the OAuth consent screen (External; add yourself as a test user, or publish it).
- Credentials → Create credentials → OAuth client ID → Web application, with the Authorised redirect URI the Storage page shows (
https://your-site/plugins/storage/oauth). - Paste the client ID and secret, Save, then Connect Google Drive and allow it. The site can only see the files it made itself (the
drive.filepermission).
Uploads are resumable, in 8 MB pieces. Drive has no address a player can stream from reliably, so videos play through this site: the player gets a signed link to plugins/storage/serve.php, which fetches the piece the player asks for (seeking works). That saves disk here, not bandwidth - every byte watched still goes out through this server - and Google allows one account 750 GB of uploads a day. Good for an archive or a small site; a busy site wants S3 or R2.
Files & moves
- On each store - how many files and how much is on each store.
- Waiting for a second try - the files a store did not take, with Try them now.
- The videos that were here before - only files written after a store is chosen go there by themselves. Send the videos that are here sends every uploaded video already here - original, sizes and pictures - a few videos every two minutes (job Storage, sending the files that are here). A video still being converted is sent when the encoder is done.
- Move to the store in use - after choosing another store, move the files of the old one: five every two minutes (job Storage, moving files), optionally deleting each from the old store once it is across. Until a file is across it keeps playing from the old store.
Upload by FTP
Members upload with FileZilla or any FTP program - no browser, no PHP upload limit - then press Import, or the site picks finished files up by itself. A cron job (Upload by FTP, importing, every two minutes) turns them into videos a few at a time through the same road as a browser upload: the video types the site takes, the size limit, the uploads a day of their package, the converter and the file storage.
How the accounts are made - one of three:
- cPanel - cPanel → Security → Manage API Tokens → Create. Give the cPanel address (
https://example.com:2083), username, the token, the domain of the logins and the folder for the members' folders (from the cPanel home; outsidepublic_htmlis best) and an optional quota. Logins look likem12_name@example.com. - aaPanel - aaPanel → Settings → API interface: switch it on, copy the key and allow this server's IP address.
- Your own FTP server - for a VPS: ProFTPD (mod_sql) or Pure-FTPd reads the accounts from the table
aio_storage_ftp_users(SHA-512 crypt passwords). The page shows the settings for both; fill in the MySQL user and password, restart the FTP server. Set the system user and group the files belong to (usually the web server's, www-data is 33).
What members connect to - the FTP address (may be another host name), the port, and The members' folders on this server: the full path where each member gets m<id> (the same folder the panel makes them in). Tell members to use TLS shows "FTP with explicit TLS".
Who, and what becomes of the files
- Who may upload by FTP - every member who may upload; members whose package has May upload by FTP (a new switch on every package); or the site team only.
- Imported videos come in as - Private (the member adds a title and publishes) or Public at once, titled after the file.
- Largest file (MB) - 0 keeps the member's own upload limit.
- Files imported per run, Pick finished files up by themselves, Show the tab to visitors who are not signed in.
What members see. A third tab, Upload by FTP, beside Upload a file and Import from a link, and the same in + Create. Their page (/plugins/storage/ftp) makes the account with one click and shows the address, port, protocol and username; the password is shown or copied only when asked (Show, Copy) and can be changed (New password) or the account closed. In your folder lists what is there - Ready, Still arriving (changed in the last minute and a half), Not a video type, Too big - to tick and Import. Imported lately links each new video to its edit page; a file that failed is put back in the folder with the reason.
In the panel - the accounts (new password, close), the imports (state, reason, Again), Run the import now. The accounts of members who are blocked or deleted are closed (daily job Upload by FTP, closed accounts); the files in their folder stay.
Switching the plugin off
Nothing is deleted. Files already on a store with a web address keep playing from it (the plugin leaves that address to the core). Files on Google Drive or a private bucket do not, until the plugin is on again.
For developers
The core asks the filter media_store for the store and calls put, has, remove, url and test on it (includes/ftp.php lists them). Another plugin can add a store of its own with the filter storage_drivers: a class with those methods (extending StorageDriver in plugins/storage/drivers/base.php is the easy way), its file, a label and the fields of its settings. The action storage_ftp_imported($videoId, $memberId) follows each FTP import.
Honest limits
- Only files written after a store is chosen go there by themselves; the rest wait for Send the videos that are here.
- Google Drive saves disk, not bandwidth; Google's own limits apply (750 GB of uploads a day per account, API quotas).
- A single S3 file can be as big as 10,000 parts of 16 MB (160 GB).
- Upload by FTP needs cPanel, aaPanel or an FTP server you run; PHP alone cannot open an FTP port for members. The folder the FTP accounts write into must be readable and writable by PHP.
- aaPanel's API was tested against a stand-in built from its documentation, cPanel's UAPI the same way; the first real account on your server is worth a look.