How to Sell Product Files hosted on Amazon S3 with WooCommerce

In this article, we will walk you through the process of selling WooCommerce products stored in Amazon S3.

Requirements:

Create WooCommerce downloadable files

Files located on your server

If your files are uploaded to Media Library, you need to protect them with PDA Gold and offload them to S3 bucket with PDA S3 Integration extension.

1. Connect with Amazon S3

Once activating our plugins, navigate to Prevent Direct Access Gold >> Amazon S3 menu from your admin dashboard.

Simply insert AWS key and secret to connect our plugins with your Amazon S3 bucket.

2. Protect and offload files to S3 bucket

To protect a file, hover its title and click on “Protect” button link.

Once the file is protected, click on “Sync” button to sync it to S3 bucket.

After that, go to create WooCommerce downloadable files.

Files already stored on S3 bucket

In case your files are already hosted on S3 bucket, you need to show them under Media Library with S3 Smart Upload plugin.

You can also use this plugin to upload files directly to Amazon S3 bucket from your local without storing them on the server.

1. Connect with Amazon S3

After activating our plugin, navigate to the plugin’s settings page under Media >> S3 Smart Upload menu from your admin dashboard.

You will see the guide to configuring your S3 access keys in wp-config.php file.

Once done, reload this page and start adding your S3 files to Media Library.

2. Show files under Media Library

All files in your S3 bucket will be listed under the plugin dashboard.

Simply right-click on the filename and choose “Add to Media Library”. The file will be shown and managed under your Media Library as normal.

Create WooCommerce downloadable files

Go to create a new product or edit an existing product.

  1. Tick Downloadable checkbox
  2. Click on “Add file” button to choose the protected offloaded file
  3. Fill Download Limit – the maximum number of times (clicks) a customer can download the file (optional)
  4. Fill Download Expiry – the number of days the download link will expire from the day of purchase (optional)

It’s important that you choose “Force downloads” (recommended) or “Redirect only” option under WooCommerce Setting >> Products >> Downloadable products page for our Amazon URLs to work properly.

Upload files from WooCommerce dashboard

Since S3 Smart Upload version 1.3.0, you can upload a file to S3 bucket directly from WooCommerce or Dokan dashboard.

Simply click on the “Offload to S3” button and select the file you want to sell via WooCommerce. The process is similar to when you upload files via our plugin’s dashboard.

How the function works

Amazon S3 secures files by making them private. That means no one can access the file URL directly once it’s protected and offloaded to the S3 bucket.

When the file is sold via WooCommerce, our plugin will auto-generate an S3 presigned URL which expires after a period of time for your customers to be able to download them.

You can modify the expiration time of these pre-signed URLs in our plugin’s settings page.

Lasted updated on March 10, 2021