Direct link to image

Is it possible to have a feature where you can set the shared link (of a single file) to go directly to that file. This for example if you want to include a screenshot into a forum. At this moment you can only provide the shared link, which has to be opened outside of the forum. I tried to add the ‘/download’ variable to see if that helps, but it would only trigger an actual download, and won’t show inside a forum response.

It isn’t possible at the moment, though actively being looked into for the purposes of embedding media.

Thanks Jason for the update. Maybe something similar as the download option (additional “/download” on URI) could maybe an option to incorporate it (like “/direct” or something). It would help with certain type of documents to embed them in other locations like forums.

A proper solution would have to work with a dedicated subdomain for security reasons (not realized yet):

1 Like

This should now be possible in NC13:

1 Like

Instructions for direct image preview in NC13.

  • Create a share link of photo
  • Copy share link
  • Past share link where required and append ‘/preview’

It does work as mentioned above. I assume once 13 is being released it will be noted somewhere (on the web-page) how to use this.

NC13 was already released. You are welcome to add your short description to the documentation:

addition to Just’s post; if you past the shared link in an incognito browser and then right click> Copy Image Address – that link can be used for embedding into emails, websites, etc.

It would be nice if there was an easier way to do this. An option on the share section maybe.

I wrote a couple requests related to this…

See this wiki overview

Please submit any additional requests you have on Github. :slight_smile:

1 Like

So was there no movement on this, then? No apps or script or tiny adjustment somewhere just to add a /preview to URL’s ?

I made the assumption that of course if you can create a share link URL that you would be able to use just like an image hosting server, because that’s exactly what it is, an image hosting server (or supposed to be).

Someone please tell me i have missed something?

thx.

You are looking for nextcloud-raw

This is an example from how it works:

This Link: global-social.net/s/CLbrSSQdN6iZBGi looks like this:

while this link: https://global-social.net/apps/raw/s/CLbrSSQdN6iZBGi produces this:

2 Likes

Ahh, very interesting. It may be exactly what i was looking for. I just need to go through the code myself and make sure as best i can that everything is ok.

I suspect its not a standard nextcloud ability, and they have not even included this in the app store because … well … your post explains it quite well in a visual manner. An image on its own does not advertise nextcloud! So i suspect they never will.

I have installed it and activated it, but I can’t figure how you grab the link from it? I can get the normal url

But where in that UI do you get the changed url? (i think im just blind :-/ )

You should thoroughly read the manual.

Iv read every file, the link you provided, the blurb that is included alongside the app from inside NC and any README’s i could find. The only thing i can find on the subject is :-

If the share link is https://my-nextcloud/s/aBc123DeF456xyZ, then this app will provide access to the raw file at https://my-nextcloud/apps/raw/s/aBc123DeF456xyZ

then this app will provide access to the raw file

What does that mean? Provide it where? Does it mean you have to manually edit the URL?

I will just have to stick with adding “/preview” to the end of public links. It’s easier than manually adding stuff in the middle of the url and having to have an extra app installed. Id much prefer a button to do it, but meh. I don’t think they want one.

Demo of share link with /preview added:-

I was trying to use grease monkey to add a new button next to the “copy public share link” button that would just add “/preview” to the end of the link, so you could copy the URL+/preview with one or two mouse clicks but i think there is a security feature on nextcloud to stop any external scripts from running so i can’t use tampermonkey at all :frowning:

Who are “they”?

It is open source, you are welcome to make an app which provides a button you can click with your mouse :wink:

1 Like

O, i thought you were about to tell me how nextcloud-raw works, or more what it does?

The people who take the income from Nextcloud Enterprise i suppose, who would you think has implemented the exact “button” i mention, but the only way you can get to it is by opening the standard NC generated URL with the advertising first. This opens the image but with a drop-down link that you can then copy that does have the /preview attached. So they have already done it, just not in a way that excludes the nextcloud theming around the original URL.

So all they need to do is add this button/copy-area to the main file share section. Iv see git requests on this, but nothing has come of them, I doubt it will.

https://jackdinn.co.uk/s/jn9AoK8D7MKsFGC/preview

You are completely on the wrong track.
It’s all about Content-Security-Policy.

You are most likely correct. I’m just a noob, really. But attaching a /preview to a URL surly can’t be a security risk. I don’t know, though.

Are you suggesting that if i post links with /preview attached to the end, that is a security risk to my server? You got me a little concerned now ^^