Signed URLs for private files #
Signed URLs are used when you want to make a private file (or object), temporarily available. Popular use-cases include digital goods, such as pictures or downloads which are stored in private buckets and customers can download them when a purchase was done.
For the difference **private** vs. **public** files, please note: by default all files are private. If you intend to make a file public, please read on [here](/multi-node/s3-object-storage/SSL-reverse-proxy/).
Example Code #
The following example uses PHP but would look similar in any other language.
The objective: create a signed-url for the file private-file.pdf
.
|
|
The most important part of this example is highlighted above:
- we created a URL to the file private-file.pdf
- the URL is valid for the next 20 minutes