Hi all I’m trying to send files from NetSuite to a...
# integrations
s
Hi all I’m trying to send files from NetSuite to an external system using
multipart/form-data
. Text files upload correctly, but binary files like PDFs are getting corrupted. I suspect this is because
file.getContents()
in NetSuite returns the content in base64, while
multipart/form-data
requires the raw binary stream. How can I resolve this issue so that binary files (e.g., PDFs) are sent properly?
d
I think it should not be multipart/form-data, so just application/x-www-form-urlencoded because base64 is just string. And you need to convert base64 to file content in your external API.
s
Getting the error for this context type
Copy code
{
   code: 15,
   message: "Please ensure that the name of the attachment has less than 100 characters."
}
If I create the body with small attachment data, then will there be another error { "code": 33003, "message": "Attachment not found." }
@Daring, I’m working on creating the API for bill attachments in Zoho Books.
d
Then, you can convert base64 to binary data
s
You're using NetSuite and Zoho books together? That's interesting all by itself 🙂
to back up @Daring’s comments, NetSuite cannot send binary data in any form except base64 encoded as far as I know. So you'll have to deal with that one way or another.
😔 1
s
I encountered the same issue with another client during the Jira integration while handling issue attachments.