Bulk download attachments using JSZip


This article introduces a way to bulk download attachment files as a Zip file, using the JSZip library that can be found on the Kintone CDN.

This is especially useful for users who have stored many files in a Kintone App, and wish to download all the files at once.


To make the bulk download easier, we will also use some libraries that are not on the Kintone CDN. The libraries below need to be downloaded first and applied to the App.


The bulk download flow

The bulk download process from kintone will be as follows:US_01.png

To download attachment files from Kintone, you will first need to obtain the fileKey from the records using the Get Records API. The Download File API can then be used, using the fileKey as the parameter value.

Note that the steps Get Records, Create fileKey list, and Create URLs need to run asynchronously.

JavaScript source code

Source code


Explanation of the source code

The source code places the button for the bulk download on the Record List view. When the button is clicked, the getZipFile function is called.


getZipFile starts a promise chain, making the order of the later processes clearer and handling of  asynchronous processes easier.

then() is used to pass on the object obtained from getAppRecords from promise to promise, and a list of fileKeys is created from this object.

How to Use

Change the value of the field code for the Attachment field, in the JavaScript source code. Save the source code as a JavaScript file, and name it "ZipAllFiles.js".

Upload or state the URL of the files in the "JavaScript and CSS Customization settings" of the App as below, and be sure to list them in the same order.




Save the App's settings, and update your App.


A button should appear on the Record List. Click the button to start running the process to download Attachment files as a Zip file.


  • In this sample, only data of up to 100 records will be downloaded as a Zip file.
  • The sample does not support Attachment fields placed in tables.
  • FileSaver.js has restrictions on file sizes, depending on what browser is being used.



This article introduced a method for bulk downloading.

This sample can be further extended to support more records, and support files inside tables. For downloads that may take a long time to process, implement a Spinner using spin.js for better user experience.


Was this article helpful?
0 out of 0 found this helpful
Do you have any questions or issues related to this article?
Please share your views with us in the Community forums!