1

We are using the s3 server to allow users to download large zip files a limited number of times. We are searching for a better method of counting downloads that just counting button clicks.

Is there anyways we can give our user a signed url to temporary download the file (like we are doing now) and check that token with amazon to make sure the file was successfully downloaded?

Please let me know what you think

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Ruttyj
  • 853
  • 2
  • 11
  • 18

2 Answers2

2

You could use Amazon S3 Server Access Logging:

In order to track requests for access to your bucket, you can enable access logging. Each access log record provides details about a single access request, such as the requester, bucket name, request time, request action, response status, and error code, if any.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • do you know if we are able to cancel/invalidate a signature based on this information? – Ruttyj Mar 08 '18 at 17:27
  • A pre-signed URL cannot be cancelled. It will remain valid for the duration requested when it was created. (By the way, if you have a new question like this, it is better to Ask a New Question rather than asking in a comment on an old question.) – John Rotenstein Mar 08 '18 at 21:46
0

There is no automatic ability to limit the number of downloads via an Amazon S3 pre-signed URL.

A pre-signed URL limits access based upon time, but cannot limit based upon quantity.

The closest option would be to provide a very small time window for the pre-signed URL, with the assumption that only one download would happen within that time window.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470