Good Morning, Do you know when you do an https requestion for a image file in file cabinet is the body of the request utf-8 or base64. I am going to use the N/encode module to convert the string to base64
c
CD
08/23/2023, 1:55 PM
Do you mean when you request it using the URL that’s on the file record? If so, it’ll be binary. Whenever you’re wanting to know something like this you can just look at the request headers in your browser dev tools to see the content type etc.
k
Kevin Baxter
08/23/2023, 1:55 PM
Yes I am using the url to request the image but I need it returned as a base64 string
b
battk
08/23/2023, 1:56 PM
its actually entirely dependent on the server you make a request to
battk
08/23/2023, 1:56 PM
if the content type header matches the list that netsuite counts as binary, its base 64 encoded
battk
08/23/2023, 1:57 PM
if its not, its utf-8 plaintext, at which point the body its probably useless to you because of the encoding errors
battk
08/23/2023, 1:58 PM
you really want to use N/file instead of N/https if you are getting something out of the file cabinet
battk
08/23/2023, 2:01 PM
it will do the same thing for base64 vs plaintext, but its less likely to mess up on the content type