Method to force a user to only download via one button
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

Please see image

Is there a way to FORCE the logged_in wordpress user to make him only be able to download my zip file (from Amazon S3) by clicking one grey button?

You don't have to code an entire solution. Just provide tips on methods to do it.

awarded to TheOsch

Crowdsource coding tasks.

1 Solution

Winning solution


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 ) to the file (here is a sample:

  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: , there's a simple way to make a script that produces a file in WP. Also it 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.