How a public folder works
You choose a folder, or the whole bucket. Anyone who knows the exact link of a file in a public folder can download it. The link is permanent and has this form: https://s3.bookmyhost.com/BUCKET/FOLDER/FILE (path-style addressing).
Public access is read-only. People can download and stream files, but they cannot upload, change or delete anything, and they cannot list what is inside the bucket or the folder, so a file is reachable only by someone who has its link.
This needs an account that has made a payment. Time-limited share links remain available on every account for temporary sharing.
Make a folder public
You can do this in mypanel or in the S3 console. In the S3 console, open it from mypanel (a console session started with only an access key and secret can show and copy public links but cannot change them).
- Open your bucket
In mypanel open Storage and your bucket, or open the S3 console from mypanel.
- Choose the folder
Pick Make public on the folder, or enter the folder name in the public access section. Choose the whole bucket only if every file in it may be public. The folder does not have to exist yet.
- Confirm
Read the warning and confirm. Do not put private files in a public folder.
- Copy the link
Use Copy public link on a file. Special characters such as spaces in the file name are encoded in the link for you.
Upload MP4 videos so they play in the browser
A file plays inline only if it was stored with the right Content-Type. Upload MP4 videos with the S3 console or an S3 client that sets Content-Type to video/mp4 (images: image/jpeg, image/png). BookMyHost does not change the Content-Type of stored files.
Seeking in a video works, because range requests are supported on public links.
Make it private again
Choose Make private on the folder at any time. The links stop working for everyone right away. Making a parent folder public includes the folders inside it, and making that parent private later does not bring the inner folders back, so publish again only the folders you want.
A bucket can have up to 10 public folders. Backup buckets that the panel manages for servers, Tally and Kubernetes cannot be made public.
Costs and limits to know
Every download of a public file counts as a GET request on your bucket, in the same way as other S3 requests. Read S3 object storage prices for the request allowance and price.
Some browsers block a PDF or an HTML page from displaying when you open its public link directly. Downloading it, or using it from your app, works. Public links are meant for images, video and downloads used by your site or app.