Looking for advice: I have a 3rd party app that w...
# suitescript
d
Looking for advice: I have a 3rd party app that wants to make a request to a custom NetSuite RESTlet to retrieve multiple PDF files as a response. I don't
think
I can 'archive' multiple files into a .zip using SuiteScript (maybe?), any thoughts?
d
they just released
N/compress
in 20.2, I assume that would be the way to go
t
Hey @darrenhillconsulting, what about having the RESTlet return an array of the base64-encoded PDFs? The response might be huge, so that's probably not an ideal approach. But it might work. Another potential approach: Add a middleware layer that dowbloads the PDFs, zips them, and returns the zip as a binary.
b
you probably want to be very clear about what you are returning with your restlet
you have very limited control over content types, none of which are friendly to binary files
your basic options are to return a plain text response with the contents of your pdf in base 64
or a json response with the base64 contents of your pdfs somewhere in your json
d
This is all helpful, thanks.