Uplink Share Folder URL, Downloading it

My question here is:

I’ve added a folder to a bucket
I’ve added files to the folder
I’ve created a share URL:

uplink share sj://testencr/testfolder --url --not-after=none

→ I receive a URL, I open the URL, I click download.

I get a file… with no extensions… it’s not a zip… it’s ??

What can I do with what I downloaded?

Hello @louloupop,
Welcome to the forum!

Your browser and OS manages extensions. What is filename in the bucket?

uplink ls sj://testencr/testfolder/

Hi,

Well that is the thing. I am requesting the folder itself, not a file within.
sj://testencr/testfolder is a folder

but STORJ allows me to download it when visiting the URL. And it actually downloads a file, that is the size of the content. The testfolder has 2 images in it and they are together about 31kb. When I download sj://testencr/testfolder using the share URL, I get a file of 31kb.

But it’s not a zip? I don’t know how to process whatever I have downloaded

As you using the ‘share url’ how are you processing/triggering the download? In a browser? Have you formatted the URL to use /raw/ instead of /s/?

I wasn’t aware it was possible to download a folder so you might just be downloading the html of the share webpage. Check it in notepad or a text editor?

There is no feature to download a “folder” or bucket via browser. The “folder” - is a prefix in the objects’ names, it’s not a folder actually.

You need to use any other integration options like uplink, rclone, FileZilla, Cyberduck, etc. to download all objects with needed prefix.

You may also try to use some browser extensions, which can recognize and download all objects from the opened “folder” in the browser.

1 Like

Both ways give me the same result.

So i replace /s/ with /raw/ and that gives me a 31kb file
I can also just do the /s/ URL and press the big Download button.

This is how it looks:


As you can see in the URL, this is literally the folder, not a file in it.

I already checked it in Notepad++ and it’s just a bunch of gibberish. It’s also not the HTML page. The file was 31kb, now I added a 1mb photo to the folder and now the file is 1,16mb

Well that’s what you say. But see below:

This is the screen I get, when I ask for a share url for the folder. It has a download button and I can replace /s/ with /raw/ and also download it that way. So my question is what is the file I get when I click this? The file was 31kb, I just added a 1mb photo to it and now it’s 1.16MB as you can see on the image.

I have no extensions or anything special.

I cannot reproduce it.
How do you created a “folder”?

Try to add a .zip extension to the downloaded file, can it be opened as an archive?
What are caveats for the generated access grant?

uplink access inspect

you need to hide keys or just show caveats, if you going to past it here. If it’s a root access grant, there would not be any caveats.

Hi,

The issue is not about access or whatever. My issue is that I can download this “folder” as in the screenshot. The result is not a zip file, when I change the file’s extension (it has no extension) to zip, I can not open it, it’s an invalid zip. So my question is, what did STORJ send me here?

Hi,
there is no option to download it as an archive. You may download content one by one object.
For downloading “folders” (prefixes) or buckets you need to use tools like Cyberduck, FileZilla, rclone, uplink, etc.

You may also try to use Downloader extensions for the browser to download all objects at once (DownloadThemAll for example).

But you can…

Go to your storage and do

uplink share sj://testencr/testfolder --url --not-after=none

The URL you get then, can be downloaded. Even though it is a folder and not a file. So my question, what is the file I get when I press download. Above command brings you to the screenshot in my previous posts

The objects storages include Storj’s one doesn’t have a concept of “folders”, but they have prefixes divided by slash, they can help the client’s software to implement filesystem-like behavior. However, the prefix without an object cannot be created, to bypass that the clients software usually creates an empty object with that prefix, this way it can look like a “folder”.
So, when you generated a link to the prefix, you can download that empty object using this link, however, such links usually used to construct a direct link to each object with the same prefix.
So, based on your example to construct links like:

  • https://link.storjshare.io/raw/r7ht737jfjf733fj37rf/testencr/testfolder/object1.jpg
  • https://link.storjshare.io/raw/r7ht737jfjf733fj37rf/testencr/testfolder/object2.jpg
  • etc.

To download all objects with that prefix you need to use tools, which are able to do so, if you want to use only shared URL, then for CLI it would be wget or similar, for the browser it would be some smart extension, for the desktop it would be some Downloader application and so on.

You may also provide an access grant generated for this prefix to your friend (but I would suggest to limit it to read-only and have a time-based limits), they can import this access grant to their uplink and download everything from there.
It could be more safe to provide an S3 credentials generated for this prefix (read-only and time-based limit too) to allow your friend to use them in tools like Cyberduck and download all needed objects.

By the way, you get all three options when you use