Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Don’t miss your chance to meet our SuiteGurus—NetSuite Support professionals and subject matter experts with extensive experience in select product areas, including OneWorld, Advanced & Basic Accounting, Supply Chain Management, Receivables & Payables, CRM, Account Administration, and the SuiteCloud Platform. Full Conference attendees can prebook exclusive 30-minute one-on-one sessions for your product questions.
Spots are limited! Register through your Agenda Builder and find SuiteGuru under Agenda Enhancements.
How to fix blank PDF file sent using https.put in a SuiteScript?
Hi,
I am new to suitescript and want to implement https.put() to upload a binary file (pdf, docx, image) based on either the file_id from file cabinet or actual file selected by user from his/her computer to upload. In any case, currently when I upload a pdf, a blank pdf is created on the target server. Could you please guide me the steps to follow? Here is the code I wrote
var fileObj = file.load({
id: bm_fileid
});
var putreq_headers = {};
putreq_headers['Content-Type'] = 'application/pdf';
var filecontent = fileObj.getContents();
var filebase64 = encode.convert({
string: filecontent,
inputEncoding: encode.Encoding.BASE_64,