I can't able to access public uploaded file via link

Hey StorJ Team,

I can’t access the publicly uploaded file through the link. We are using uplink-nodejs library in our code. A new access token is generated when we upload files. So can you please help with this. let me know

My requirement is that I have uploaded a file which can access anytime anywhere. No account login required.

thank you

Hello @foreverfree100,
Welcome to the forum!

To have a public link you have several approaches:

  1. Use presigned URLs, see Creating and Using Presigned URLs with Storj - Storj Docs and example for js: AWS SDK Nodejs - Storj Docs
  2. Use the Self-hosted s3-compatible Gateway and run in the web-site mode with a reverse proxy to publish it.
  3. Use a linksharing service: Creating Public Buckets and Embedding Content - Storj Docs. However, I do not think that uplink-nodejs binding have a required methods to register the access grant on the GatewayMT to generate a linksharing URLs:

If we want to open a file in the storage, from which link can we do it? There is an option. I did what you said, but if I put the name of the bucket in it, all the files in the bucket show up.

We’re doing this for security reasons because if the Storz link gets leaked, a whole bucketful of our stuff will come out that we don’t want.

If you want to share only one file, then share only it, not the whole bucket/prefix.
Example for CLI:

uplink share --url --not-after=+1h sj://my-bucket/my-prefix/my-file.mp4

It will generate the linkshare URL which will expire after 1 hour (--not-after=+1h), it would also show the used access grant and generated S3 credentials.

Please note, that you may specify the used access grant without configuring uplink by providing it with the --access option.

uplink share --access 1dhjrujndjfd.... --url --not-after=+1h sj://my-bucket/my-prefix/my-file.mp4

Thank you very much for this help.

My team said, they cannot get the single file url direct thou.

This gets them the page with the video file on it. We just need access to the finale file url for secure download in our application.

Is this possible with storj? If so how please and thank you.

Yes - modify the url generated by adding “raw”

Here’s a link to where in our documentation it talks about making embeddable content links:

2 Likes