rndme / download

file downloading using client-side javascript
MIT License
2.29k stars 418 forks source link

Download not working with filename #77

Open ijunaid8989 opened 6 years ago

ijunaid8989 commented 6 years ago

This line works perfectly

download("https://media.evercam.io/v1/cameras/abbot-blwnj/compares/9thma-tloxtql.gif?")

but it gives a file name as 9thma-tloxtql.gif but when I put a name as

download("https://media.evercam.io/v1/cameras/abbot-blwnj/compares/9thma-tloxtql.gif?", "hello.gif")

It also downloads a file but It cannot be used also file cannot be opened as well.

image

where I am wrong?

vstruhar commented 5 years ago

I have the same issue, when I use second argument as name it downloads an empty file.

vstruhar commented 5 years ago

Here is the solution, I didn't notice it in the documentation: https://github.com/rndme/download#image-via-ajax-for-custom-filename---live-demo

bichotll commented 5 years ago

I don't understand why that's the reason tbh..

nuthinking commented 3 years ago

I guess because a.download doesn't like URLs from other domains, meaning they have to be converted to a blob first. For me it sucks because I'm dealing with videos, hence I guess I'm stuck with the original filename.