0

I am currently having an issue creating a valid .zip file in SuiteScript 2.0.

Currently i am using the file module to create a file:

var zipFile = file.create({  // create zip file from 3 loaded files above
   name: 'bsb_zipped_files.zip',
   fileType: file.Type.ZIP,
   contents: file1 + file2 + file3, // loaded files to place into archive
   isOnline: true
});
zipFile.folder = 32112;
var zipFileId = zipFile.save();

And this works, to a degree, it creates a .zip file in the correct location but it's not a valid zip file and i can't extract the contents. I have seen several posts to say there is no API fro creating zip files but i'm sure there must be as otherwise ZIP wouldn't be a valid enum for the file.create function.

SgtGrarm
  • 131
  • 7

1 Answers1

1

Netsuite has a lot of holes regarding valid field and type arguments.

That is not a valid way to create a zip file -- even though you can just append files you also need a directory structure

If you found a way to create the directory structure and Base64 encode it you may be able to get this to work

I think it would be easier to write a lambda function or set up an Ec2 instance with a web service to create the file for you.

bknights
  • 14,408
  • 2
  • 18
  • 31