When customers upload files through your wp2print site, the files will be stored into an S3 bucket in your account on Amazon Web Service (AWS). The great advantages of S3 on AWS are:
When you first receive your wp2print, it will not yet be configured to upload files to your bucket in AWS S3. Instead, it will be configured to upload files into the /uploads/ folder of the server hosting your wp2print site. Although it is acceptable to use the "local" file storage while you are configuring your site, you must switch the file upload target to AWS S3 prior to using your wp2print site in production
You must switch the file upload target to AWS S3 prior to using wp2print in production
The steps required to switch the file upload target to AWS S3 are:
This page contains instruction on how to Create a new AWS account.
With AWS S3, you must create and configure a "bucket" that your files will be stored in:
The screenshot below shows the configuration for creating a new bucket. You must replace the name of the bucket, shown as "mybucket" below, with the name of the bucket you will use:
After the bucket has been created, edit the newly created bucket and navigate to the Permissions tab
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"POST"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [],
"MaxAgeSeconds": 3000
}
]
After editing, the CORS policy for the bucket should be as shown below:
In order to provide access to your AWS bucket to your wp2print website, we must create a new AWS IAM user. Your wp2print website will be configured with the credentials of this new IAM user which will give your wp2print access to store files in your AWS bucket.
Here are the steps to follow:
Create new Policy
The policy we are creating grants permission to perform actions on the bucket specified. Below is the policy text:
You must replace the text "mybucketname" with the name you have assigned to your new bucket
{
"Version":"2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::mybucketname",
"arn:aws:s3:::mybucketname/*"
]
}
]
}
This video illustrates configuring creating the IAM policy and creating a new IAM user account:
After you have created your AWS bucket and your AWS IAM user, the final step is to configure wp2print with this new information.
In the wp2print admin site, navigate to wp2print>>settings then select the "File upload" tab at top. In the dropdown "File upload target", select "Amazon S3". Then configure the following information:
S3 Region:
The S3 Region is a code assigned by Amazon for each of their data centers. The Region codes are displayed in the table below:
Location | AWS Region |
---|---|
US East (Ohio) | us-east-2 |
US East (N. Virginia) | us-east-1 |
US West (N. California) | us-west-1 |
US West (Oregon) | us-west-2 |
Canada (Central) | ca-central-1 |
Asia Pacific (Mumbai) | ap-south-1 |
Asia Pacific (Seoul) | ap-northeast-2 |
Asia Pacific (Singapore) | ap-southeast-1 |
Asia Pacific (Sydney) | ap-southeast-2 |
Asia Pacific (Tokyo) | ap-northeast-1 |
EU (Frankfurt) | eu-central-1 |
EU (Ireland) | eu-west-1 |
EU (London) | eu-west-2 |
South America (Sao Paulo) | sa-east-1 |
S3 Path:
The "path" added to the URL used to store the files. The "path" will allow you to sort the files into folders by date.
As of May 2023, you can locate your S3 Path from wp2print>>Settings>>File Uploads. This video illustrates configuring the wp2print settings with your AWS bucket name and credentials: