Linkshare read object metadata and content-type

I can’t find much documentation about the supported features of the linkshare feature.

I implemented a simple screenshot upload endpoint and using currently the hidden wrap query param like “https://mydomain.test/thefile.png?wrap

The missing support of the link-preview for fb & skype and co. requires me also to implement my own preview page.

For this it would be nice to be able to query the object metadata over the shared link to be able to access them inside the preview page and not on the server over regular S3 request.

The content type of the http-response of the object seams to be generated over the filename.

Are there hidden metadata fields that sharelink can use like:
“filename” to set the download filename
“content-type” to set the content type
“redirect” for an http redirect
… and others?

Best would be in general to let linkshare read a single wellknow metadata property and at it to the http-response headers like:
object meta: {‘http’: { ‘status’: ‘302 Found’, ‘headers’: { ‘location’: ‘https://www.example.org/index.php’, ‘x-myheader’: ‘ok’ } }
would hive a http response:
HTTP/1.1 302 Found
Location: https://www.example.org/index.php
x-myheader: ok
… others

or for filename:
object url: “https://mydomain.test/2024/radhwe
object meta: {‘http’: { ‘headers’: { ‘Content-Disposition’: ‘attachment; filename=“origname.png”’ } }

HTTP/1.1 200 OK
Content-Disposition: attachment; filename=“origname.png”
…others

We have a usage documentation:

We have a technical documentation as well:

And regarding the metadata too: edge/docs/linksharing.md at 82d843c4a692e511ef10611042743aed5c205447 · storj/edge · GitHub

So, actually the content metadata is provided/detected on upload of the object and then used by the Linksharing service to allow/disallow a preview.

You may also see most of the flags (similar to ?wrap) here:

However, they likely wouldn’t work on custom domains out of the box, or you would show the Storj branded page. In other words, you usually need to implement a preview yourself.
Usually the custom domains are used for Hosting a Static Website - Storj Docs and when you open it without an object name, it would try to search for index.html or similar page. So, perhaps you may implement there a preview which can be rendered on a static website.

Thx, i only looked on google and storj.com doc.
Most of the features are already there/implemented.

Link Preview does not work somehow.
I think it’s because the link is shared with ?wrap, need to test it out.

A metadata option for location+status header for to create a redirect would be nice to have.
With it a link shortened could be implemented.

HEAD request is handled currently and could be used to retrieve some metadata

The custom headers combined with the HEAD request could be used inside the preview page itself to load some required information like the optimized preview-image url’s or something exetic like an SSL or OTS signatures https://opentimestamps.org/

@Alexey The link-preview url of the generated html-meta are buggy.
If a custom domain is used then they still generate link.storjshare.io url’s to a 404 request.

Example:
https://mydomain.test/2024-29/T11187a.png?wrap

will include for the og:image and twitter:image html meta tags the url:
https://link.storjshare.io/raw/my-bucket/2024-29/T11187a.png?v=ab52919
and it returns 404

Reported this issue here too

1 Like

Oh, I now get it. You mean the preview on the social media, not our preview service on linksharing.

Yes, preview for the chat app whatsapp, skype and so on

1 Like