robbederks / downzip

NPM library to enable client-side code to stream potentially large files into a zipped download
MIT License
35 stars 12 forks source link

Feature request: Directories #22

Closed gunar closed 3 years ago

gunar commented 3 years ago

It'd be useful to be able to create directories inside the generated zip file and place files inside these sub-directories.

Any idea how much work that would entail?

~It seems you're already using jszip so it should be relatively straightforward.~ EDIT: jszip is only used in tests, in such case I recommend moving it from dependencies into devDependencies.

robbederks commented 3 years ago

Shouldn't be too hard, just have to add it to the zip generator. Feel free to make a PR!

gunar commented 3 years ago

@robbederks It might take me a while to get the hang of this codebase and the zip file-type. Hope you're not offended but is there any chance my company can pay you or someone or build the feature? Consider it a bounty program. Can you give me a quote?

robbederks commented 3 years ago

I'm sorry, I'm not taking in any more work atm. In any case, I still stand by the fact that this should be simple to add in a PR by anyone with some JS skills and the zip64 spec.

I think it's a great added feature, so I'll leave this issue open for now

gunar commented 3 years ago

It works out of the box. Just include the relative path (using forward slashes) in the filenames.

4.4.17 file name: (Variable)

   4.4.17.1 The name of the file, with optional relative path.
   The path stored MUST NOT contain a drive or
   device letter, or a leading slash.  All slashes
   MUST be forward slashes '/' as opposed to
   backwards slashes '\' for compatibility with Amiga
   and UNIX file systems etc.  If input came from standard
   input, there is no file name field.  
robbederks commented 3 years ago

Even better!