Shubham S
10/08/2024, 6:55 AMfile.getContent()
in NetSuite to convert the file to a blob and sent it through the API, the format turned out incorrect. I also tried converting it to an array buffer, but the issue persists.Celigo AI
10/08/2024, 6:55 AMAI generated answer (using internal Slack threads):Based on the conversations, it seems that the issue you're facing is related to the way NetSuite handles binary content. When you use
file.getContent()
, it returns the content in base64 format. This is because NetSuite represents binary content using base64.
When you try to convert this base64 content to a blob or an array buffer, the format might not be preserved correctly, leading to the issues you're experiencing.
One of the users in the conversation mentioned that they managed to work around this issue by using a proxy on another server. This proxy takes the string from a post request from NetSuite (in JSON format) and forwards it to the provided URL via Multipart. The proxy runs in NodeJS where it works as expected.
Another user suggested using SuiteTalk, NetSuite's web services integration tool, to handle the file retrieval. However, it's not clear from the conversation whether this approach was successful.
It's also worth noting that one user mentioned that attempts to convert binary content to text are doomed to fail because binary content isn't text. This might explain why your attempts to convert the file to a blob or an array buffer are not working as expected.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
10/08/2024, 6:55 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85154295
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848581553
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841589689
Celigo AI
10/08/2024, 6:55 AM