在NetSuite脚本中使用JSZip

时间:2019-06-28 07:19:00

标签: netsuite suitescript2.0 jszip

我使用file.create方法创建了一个zip文件。但我想从文件柜的zip文件中添加文件。

JSZip代码(不起作用):

var zip = new JSZip();
        zip.file("Hello.txt", "Hello World\n");

        var img = zip.folder("SuiteScripts");

        var content = zip.generate();
        location.href="data:application/zip;base64,"+content;

创建邮政编码(有效):

var fileObj = file.create({
            name: 'test.zip',
            fileType: file.Type.ZIP,
            contents: null,
            folder: 270129
        });

0 个答案:

没有答案