Ask coding questions

← Back to all posts
How to download a folder onto a user's device in javascript
Dunce

I know you can download a file onto a user's device, like this:

But how would I download a folder onto a user's device using a similar method? I've tried:

But it just replaces the backslash with an underscore in the filename, instead of creating a new folder. I've also tried it with a forward slash, but that didn't work either.
I haven't been able to find any information about this.

Voters
Dunce
Comments
hotnewtop
Coder100

You can't download folders, but you can download zips.

Dunce

@Coder100 Okay, how do I do that then?

JBloves27

Hiya, not sure if this will help you, but here

Hope this helps!

Dunce

@JBloves27 Not exactly what I was looking for. But thanks! :)

JBloves27

hmmm, ok! Np @Dunce