-
-
Notifications
You must be signed in to change notification settings - Fork 185
Download Files as a ZipFile
currently we have only one way to download files, but when you try to download a multiple items, your machine/device downloads folder quickly becomes a mess.
so to solve that, we now have 2 options for downloading files
- 1- you can download separate files like normal.
- 2- download selected files as a .zip file.
if you decided to go with the second option, you will need to install a couple of extra packages "will add about extra 600kb to manager.js file"
yarn add file-saver jszip jszip-utils
// or
npm install file-saver jszip jszip-utils --save
and that's it, we already took care of everything else & if none of those packages is found we will fallback to the default separate file saving.
also to make things easier, the zip file will be named after the current folder name or “media_manager” if you were at the root.
-
because the zip file is created into the memory first, its highly recommended you check JSZip Performances/limitations
-
for big files, where memory is an issue you may wanna check https://github.com/Stuk/jszip/issues/308
browser: Chrome v63.0.3239.84
files_no: 24
size: 109.6 MB
time to zip: 1.88 min
zip size: 102.1 MB