Share Link direct url with file extension (.jpg .png .txt .pdf .mp3 etc)

When creating share links with NextCloud 13.0.2 - by default - the link looks like this:
(test file)

/preview can be added to the end of the url to make the file display in a basic form. Just the file, no extra elements.

However, is there a way to change the share link behavior so that by default it links directly to the file with the file extension? For sharing pictures via url online, this makes the url appear to be more trustworthy and gives an impression of what the url will link to before it is clicked. Also, some services parse the url, determine what it links to, and create previews. Some of these services expect a file extension in the url.

For example:

Also, is there a way to use a concatenated version of the file name as the share link identifier?

For example:

This seems like the most optimal way to handle share link urls for my application.

1 Like

The “cryptical” URL is by design.

Which services are relaying on the extension? I like to understand what they are tryin’ do reach.
As soon as the service fetches the file it can detect file type by mime or other common ways.

For example a playlist for mp3 files, which is unfortunately not possible at the moment. But this would be a nice feature for mp3 streaming out of nextcloud.

Create an empty text file, name it playlist.m3u8 and fill it with data (or generate the playlist with Winamp):

#EXTINF:344,Artist - Title1
#EXTINF:333,Artist - Title2

I believe the naming is to help obfuscate files links as a general rule, but you can submit a feature request to the Nextcloud Server github here. My suggestion follows…

Here is an example taken from this article on Making a Nextcloud Mystery box.

If you have admin access to your account you can install the app Share Renamer, which is sadly not listed in the Nextcloud App store. Login to your server and navigate to the apps directory to install from Github.

cd /var/www/nextcloud/apps

git clone

Now login to your instance and Enable the Share Renamer app.

Once active you’ll be able to rename share hyperlinks to whatever you like. Just browse back to Step 2 from article. instead of the usual

1 Like

So I am having a similar issue where I tried your suggestion ‘just’ with the mystery box and that didn’t work, since I was trying to add an HTML5 audio tab to stream to a website. Are there any other suggestions on how to do this via Nextcloud? Can the “/download” link be turned into a preview or streaming link for HTML5? I’d appreciate any pointers definitely a newb here. :slight_smile:

1 Like