Hey guys! I have a problem that I need some help with. I am receiving a JSON object which includes a media link(URL). I need to create a file in the filing cabinet by only using that URL. Not seeing this in the File Module Docs. Am I missing anything?
b
battk
11/12/2020, 10:00 PM
suitescript is pretty bad at binary
battk
11/12/2020, 10:01 PM
your best hope is to use N/https to get the file and hope the media server is nice enough to have a content type that netsuite can interpret as base 64
👍 1
battk
11/12/2020, 10:01 PM
save the body of the response in a file and hope for the best
r
Robert Regnier
11/12/2020, 10:20 PM
Try this:
var response = https.get({
url: 'https://yoururl.com'
});
Use response.body as the contents when you're creating the file.