- Create an access grant using the same encryption phrase used when you created S3 credentials
- Setup uplink CLI
- Execute
uplink share --url --not-after=+2h sj://uploads/main/06b762c99314d18854fc99aa68b58a83.png
You will get a public URL for exactly this object, it will expire after 2 hours. If you specify --not-after=none
, it will never expire.
But I guess you have some kind of CMS and you have a lot of objects like this. If so, you need to setup a static web site and use your own domain instead of https://gateway.storjshare.io
for such objects in the configuration of your site.
You may also skip the static web site setup and generate a public URL for the prefix
uplink share --url --not-after=+1h sj://uploads/main/
replace /s/
to /raw/
in the generated URL and use it instead of https://gateway.storjshare.io/uploads/main/
in every link on your site.
If you develop an own site or mobile app you may also use presigned URLs:
- Example for python: Creating and Using Presigned URLs with Storj - Storj Docs
- Example for AWS SDK NodeJS: AWS SDK Nodejs - Storj Docs
- Sample NodeJS and React code using presigned urls and AWS SDK V3