After 4.16.0 version, WordPress File Upload plugin supports Amazon S3 uploads. Administrators can choose to transfer the files uploaded by their website visitors to an Amazon S3 account.
To enable Amazon S3 uploads, we first need to link the plugin with an Amazon S3 account to have access to it. We do this very easily by going to the plugin’s Settings in Dashboard:
There is an Amazon S3 Uploads area which shows that Amazon S3 Uploads are not activated and prompts to press the “Press here” button. By pressing this button, two textboxes appear to enter a Key ID and a Secret, as shown below:
We take these two codes from the Amazon S3 account we want to link with the plugin. This article provides instructions how to get them.
Then we press Finish button to finalize the procedure. After a couple of seconds the page will refresh and we will see the “Activated” text, which means that the plugin has been linked with the Amazon S3 account, as shown below:
Now we are ready to enable Amazon S3 uploads to our WordPress File Upload plugin instances, by adding manually the attribute amazons3=”true” inside the plugin’s shortcode. Alternatively we can use the Shortcode Composer, then go to Interoperability tab and enable the option “Upload to Amazon S3”, as shown below:
Another 6 Amazon S3 options are provided:
- The Amazon S3 bucket where the files will be uploaded, by setting its name in amazons3bucket attribute into the shortcode, or in Amazon S3 Bucket option using the Shortcode Composer. This is a required option since Amazon S3 uses buckets for file storage. The bucket needs to have the appropriate permissions so that the plugin can upload files there. This article provides instructions how to set the bucket’s permissions.
- The destination directory inside the Amazon S3 bucket, by setting its name in amazons3path attribute into the shortcode, or in Amazon S3 Path option using the Shortcode Composer. If this directory does not exist, it will be created when a file is transferred to the bucket. If no destination path is set, files will be transferred to the root of the bucket.
- The access permissions of the uploaded Amazon S3 file, by setting the value “private” or “public” in amazons3access attribute into the shortcode, or by setting Amazon S3 File Access option using the Shortcode Composer. A file can be private (default), meaning that it can be accessed only by the Amazon S3 account owner, or public, meaning that it can be accessed by anyone who has a link to it.
- The ability to add the submitted userdata, if the upload form contain userdata, to the Amazon S3 file by setting the value “true” in amazons3userdata attribute into the shortcode, or by setting Include Userdata option using the Shortcode Composer. Amazon S3 allows to keep metadata for each file, so the submitted userdata are added in file’s metadata, as shown below:
- The ability to determine if the local file will be deleted or not, by setting the value “delete” or “keep” in amazons3local attribute into the shortcode, or by setting Local File Action option using the Shortcode Composer.
- The ability to share/list the Amazon S3 file by setting the value “true” in amazons3share attribute into the shortcode, or by setting Share/List Amazon S3 File option using the Shortcode Composer. If enabled, the plugin will expose a link to the Amazon S3 file through Uploaded Files Dashboard menu page. It is noted that File Access must be set to “public” for the link to work.
After enabling Amazon S3 uploads, files uploaded through the WordPress File Upload plugin will be transferred to the Amazon S3 bucket that we have set.
For any questions, problems or suggestions, please contact us.
The Iptanus team