Please help. Zip file download

Hello. Someone please help. I am making a website and I want to make a zip download link. When i upload the asset, I have to copy the link of the file and when you download it, it says something like ffdb45d2-1f82-4bb6-af70-725e352c2969-blahblahblah.zip. I want to make it only download as blahblahblah.zip. anyone know how to?

1 Like

Sorry, I don’t think its possible do you that. Can’t you just change the name once its downloaded?

Blob URLS have a base64/32 like code when being made. So, when they download a blob URL, let’s say blob:example.com/ffdb45d2-1f82-4bb6-af70-725e352c2969 it will download the ZIP with the code. Blob URLS also don’t have an extension so they don’t auto download

Glitch projects are not downloaded from a blob, they come from api.glitch.com.

No, I thought he said that you could upload assets on the site he was making :sweat_smile:

Hi Pro5714, welcome!

Here’s an idea, if I’ve understood your problem correctly:

  • Upload a file (like a zip) to assets
  • Copy the URL
  • Make an express redirect with your pasted URL like:
app.get("/Hello.zip" , (request, response) => { 
  response.redirect("https://cdn.glitch.com/2e7f2a8a-a256-4fc7-8c29-3588e9a349c6%2FHello.zip");
})

Here is a demo glitch showing it in action:

Hope it helps.

1 Like

Well, thank you all

1 Like

You do not need to make an express redirect.

The wrong filename happens because the browser thinks the token is part of the filename.

When uploading you zip file to glitch you will get a link with the format: <token>%2F<filename>. If you change the characters separating the token and filename (%2F) with a slash (/), a browser should be able to correctly name the file.
This works because %2F is an encoded representation of a slash.

As an example, both of the below links work:

https://cdn.glitch.com/330028ed-ee05-4d11-95ea-dd913cd3d0f2%2F150.png

https://cdn.glitch.com/330028ed-ee05-4d11-95ea-dd913cd3d0f2/150.png

3 Likes

thank you so much

1 Like