TheOsch's solution to "Method to force a user to only download via one button"

Hello! If i was you I'd make it the following way: 1. Make the file(s) or an entire bucket non-public. 2. Create an IAM user and grant him an acces to these file(s). 3. Write a PHP script that creates an S3 temporary link (see https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html ) to the file (here is a sample: https://css-tricks.com/snippets/php/generate-expiring-amazon-s3-link/). 4. Write another script that checks the sample: https://css-tricks.com/snippets/php/generate-expiring-amazon-s3-link/). 4. Write another script that checks the current WP user, generates a temporary link to the S3 file and "pipes" this file from S3 using the generated link to the output. 5. Make the button a link to this script. By the way, this can be an answer to your previous bounty too.
Hello! If i was you I'd make it the following way: 1. Make the file(s) or an entire bucket non-public. 2. Create an IAM user and grant him an acces to these file(s). 3. Write a PHP script containing a function that creates an S3 temporary link (see https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html ) to the file (here is a sample: https://css-tricks.com/snippets/php/generate-expiring-amazon-s3-link/). 4. Write another script that checks the current WP user, generates a temporary link to the S3 file and "pipes" this file from S3 using the generated link to the output. 5. Make the button a link to this script. By the way, this can be an answer to your previous bounty too.
Hello! If i was you I'd make it the following way: 1. Make the file(s) or an entire bucket non-public. 2. Create an IAM user and grant him an acces to these file(s). 3. Write a PHP script containing a function that creates an S3 temporary link (see https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html ) to the file (here is a sample: https://css-tricks.com/snippets/php/generate-expiring-amazon-s3-link/). 4. Write another script that checks the current WP user, generates a temporary link to the S3 file and "pipes" this file from S3 using the generated link to the output. Here is an useful link describing how it can be done: https://wordpress.stackexchange.com/questions/3480/how-can-i-force-a-file-download-in-the-wordpress-backend , it tells how to make a script that produces a file. 5. Make the button a link to this script. By the way, this can be an answer to your previous bounty too.
Hello! If i was you I'd make it the following way: 1. Make the file(s) or an entire bucket non-public. 2. Create an IAM user and grant him an acces to these file(s). 3. Write a PHP script containing a function that creates an S3 temporary link (see https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html ) to the file (here is a sample: https://css-tricks.com/snippets/php/generate-expiring-amazon-s3-link/). 4. Write another script that checks the current WP user, generates a temporary link to the S3 file and "pipes" this file from S3 using the generated link to the output. Here is an useful link describing how it can be done: https://wordpress.stackexchange.com/questions/3480/how-can-i-force-a-file-download-in-the-wordpress-backend , itthere's tells how to make a simple way to make a script that produces a file in WP. Also mit can be done as a custom page, post etc. - there are many opportunities. 5. Make the button a link to this script. 5. Make the button a link to this script. By the way, this can be an answer to your previous bounty too.
Hello! If i was you I'd make it the following way: 1. Make the file(s) or an entire bucket non-public. 2. Create an IAM user and grant him an acces to these file(s). 3. Write a PHP script containing a function that creates an S3 temporary link (see https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html ) to the file (here is a sample: https://css-tricks.com/snippets/php/generate-expiring-amazon-s3-link/). 4. Write another script that checks the current WP user, generates a temporary link to the S3 file and "pipes" this file from S3 using the generated link to the output. Here is an useful link describing how it can be done: https://wordpress.stackexchange.com/questions/3480/how-can-i-force-a-file-download-in-the-wordpress-backend , there's a simple way to make a script that produces a file in WP. Also mitit can be done as a custom page, post etc. - there are many opportunities. 5. Make the button a link to this script. By the way, this can be an answer to your previous bounty too.

User: TheOsch

Question: Method to force a user to only download via one button

Back to question