anyone work with images through netsuite
# suitescript
k
anyone work with images through netsuite
c
Do you maybe want to explain what the business requirements are? ‘cos the base64 field question you asked did not sound like a solution to any possible requirement, and I think you might be a bit lost & need a hand with solution design
k
My problem is I am trying to construct a javascript object of mapped fields. In that object I need to submit an img as a byte array. Those are the specific instructions I received from the third party company. I am assuming that I need to take an image file and convert it into a byte array. People have told me to use base64, that the image already comes in base64, to use a buffer Array, and google is not very specific on how to return a string array for the values. I need to convert an AWS image url into a byte array. The code I have been using to fetch the image based upon the url gives me a error message stating "has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource"
e
Are you displaying the image on a Netsuite form or are you just retrieving it from an external URL and storing it in the file cabinet?
b
you probably need to better explain what you are going to do with that javascript object of mapped fields
javascript byte arrays are Typed Arrays, typically
Uint8Array
the typed array is not very useful by itself, all the suitescript related apis dont use typed array
which means you are hopefully converting that mapped object into something more useful, probably using a library
since you are now dealing with cors related errors, that means you are working in client script, which means you have options like img/canvas elements, or using fetch
you also no longer have access to N/file