<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Upload file into Drop Box From NetSuite Using SuiteScript. in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698502#M31195</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;When I am trying to upload CSV and TEXT with same approach it is working but for PDF and other files which aren't text it is not working.&lt;/P&gt;&lt;P&gt;You mean for PDF I need to decode the data I am getting?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2023 12:44:35 GMT</pubDate>
    <dc:creator>Anonymous One</dc:creator>
    <dc:date>2023-07-13T12:44:35Z</dc:date>
    <item>
      <title>Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698184#M31183</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to upload files from NetSuite into Drop Box using drop box upload API. I am able to upload text as well as CSV file but while uploading files like PDF,DOC,ZIP etc. I am able to upload it but data is missing or I am unable to open that file, Is there any kind of decoding needed for such files.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 06:41:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698184#M31183</guid>
      <dc:creator>Anonymous One</dc:creator>
      <dc:date>2023-07-12T06:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698290#M31186</link>
      <description>&lt;P&gt;As noted in the other threads you found, &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_self" rel="noopener noreferrer"&gt;the&amp;nbsp;/2/files/upload&amp;nbsp;Dropbox API endpoint&lt;/A&gt; is &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#formats" target="_blank" rel="noopener noreferrer"&gt;a "content-upload" style&lt;/A&gt; endpoint, meaning it expects the file data in the HTTPS request body. The data should be sent just as a raw octet-stream (per the "Content-Type"), without any additional encoding. (Dropbox doesn't perform any additional operations, such as encoding/decoding, on the received data before storing it.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't offer help with working in NetSuite though, as it's made by a third party, but I'll be happy to help with any issues you may be having with the Dropbox API itself, but I'd need some more information. In that case, please reply with:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)&lt;/LI&gt;
&lt;LI&gt;the full text of any error or unexpected output&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 12 Jul 2023 15:19:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698290#M31186</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-07-12T15:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698462#M31188</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;UL&gt;&lt;LI&gt;the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)&lt;/LI&gt;&lt;LI&gt;the full text of any error or unexpected output&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;(see my below reply in response to you query for uploading PDF)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1st try&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;let pdfData&amp;nbsp;= file.load({&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; id:&amp;nbsp;'file cabinet file id'&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }) // this will load the file&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;let dataContent = pdfData.getContents() // this will fetch the content of the loaded file.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;let apiHeaders = &amp;nbsp;{&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Authorization": `Bearer ${API_TOKEN}`,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Dropbox-API-Arg": `{"path":"/Item Fulfillment/${pdfData.name}",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "mode":"add",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "autorename":false,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "mute":false&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }`,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Content-Type": "application/octet-stream"&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } // header for the Drop Box API request&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;let responseData = https.post({&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; body: dataContent&amp;nbsp;,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: API_URL,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; headers: apiHeaders &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;In response I got code 200 PDF was uploaded in the DROP BOX but when I tried to Open the PDF got an error that '.PDF files are supported but something went wrong&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;'.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Note - I tried same approach&amp;nbsp;to upload CSV and TEXT file it worked but not working for files like PDF,DOC,ZIP etc.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;2nd try&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;let binaryData = encode.convert({&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string: pdfData.getContents(),&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inputEncoding: encode.Encoding.BASE_64,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputEncoding: encode.Encoding.UTF_8&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(Here I tried same approach as above but tried to encode the data content and then sent it to DROP BOX)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Response - Got code 200. I was able to the open the PDF file but it was blank.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Jul 2023 06:08:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698462#M31188</guid>
      <dc:creator>Anonymous One</dc:creator>
      <dc:date>2023-07-13T06:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698482#M31190</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1724855"&gt;@Anonymous One&lt;/a&gt;&amp;nbsp;wrote:&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;...&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;let pdfData&amp;nbsp;= file.load({&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; id:&amp;nbsp;'file cabinet file id'&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }) // this will load the file&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;let dataContent = pdfData.getContents() // this will fetch the content of the loaded file.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1724855"&gt;@Anonymous One&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Are you sure the file denoted by the id is the actual file you want to upload and not some encoded form? You can ensure it as try to save this file (dataContent) on your server local place and fetch it using ftp (or similar method). Can you open properly such a file after that?! If you cannot do it, you cannot rely that such a file will be readable on Dropbox (it's the same file).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1724855"&gt;@Anonymous One&lt;/a&gt;&amp;nbsp;wrote:&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;...&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;let binaryData = encode.convert({&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string: pdfData.getContents(),&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inputEncoding: encode.Encoding.BASE_64,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputEncoding: encode.Encoding.UTF_8&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As it has been mentioned already multiple times, the content you will try to upload must not be encoded in any way!!! If encoded somehow, you will get it in Dropbox encoded too. If the content is encoded in base64, transcoding it utf-8 just change one encoding to other and finally the content is still encoded (even more for binary files such encoding is destructive or can be at least). That's why such a move is incorrect definitely! For base64 encoded file you have to decode it, not transcode!!! Usually you can do it in a platform specific way (such tools are not JavaScript specific). In web browser environment, for instance, there is atob function that can do this. In nodejs, on other side, you can use Buffer class methods for the same. To be honest I'm not familiar to your environment, but there has to be something equivalent. If you don't know for such thing, ask your environment support. You can try implement such a decoding yourself if missing.&lt;/P&gt;&lt;P&gt;Hope this gives direction.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 09:59:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698482#M31190</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-07-13T09:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698483#M31191</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mentioned in my earlier reply I tried 2 approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1st - Directly uploaded the file after reading the content of the file(which worked for CSV and TEXT file but for files like PDF,DOC,ZIP etc. file was uploading but wasn't even able to open it)&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;let pdfData&amp;nbsp;= file.load({&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; id:&amp;nbsp;'file cabinet file id'&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }) // this will load the file&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;let dataContent = pdfData.getContents() // this will fetch the content of the loaded file.&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;let apiHeaders = &amp;nbsp;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Authorization": `Bearer ${API_TOKEN}`,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Dropbox-API-Arg": `{"path":"/Item Fulfillment/${pdfData.name}",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "mode":"add",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "autorename":false,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "mute":false&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }`,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Content-Type": "application/octet-stream"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } // header for the Drop Box API request&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;let responseData = https.post({&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; body: dataContent&amp;nbsp;,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: API_URL,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; headers: apiHeaders &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2nd - When first approach didn't work I tried to encode it (file got uploaded in DROP BOX but it was blank).&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;let pdfData&amp;nbsp;= file.load({&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; id:&amp;nbsp;'file cabinet file id'&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }) // this will load the file&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;let dataContent = pdfData.getContents() // this will fetch the content of the loaded file.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;let binaryData = encode.convert({&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string: dataContent ,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inputEncoding: encode.Encoding.BASE_64,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputEncoding: encode.Encoding.UTF_8&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;let apiHeaders = &amp;nbsp;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Authorization": `Bearer ${API_TOKEN}`,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Dropbox-API-Arg": `{"path":"/Item Fulfillment/${pdfData.name}",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "mode":"add",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "autorename":false,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "mute":false&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }`,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Content-Type": "application/octet-stream"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } // header for the Drop Box API request&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;let responseData = https.post({&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; body: dataContent&amp;nbsp;,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: API_URL,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; headers: apiHeaders &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp;Regarding about if the file that I am loading is correct or not. I uploaded CSV and TEXT file using 1st approach it worked but for other files it didn't.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While loading the CSV file in NETSUITE default encoding for PDF and CSV file is same i.e.&amp;nbsp;&lt;SPAN&gt;"UTF-8" but while uploading everything&amp;nbsp;is fine with CSV but not with PDF upload.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 10:22:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698483#M31191</guid>
      <dc:creator>Anonymous One</dc:creator>
      <dc:date>2023-07-13T10:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698484#M31192</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1724855"&gt;@Anonymous One&lt;/a&gt;, I have no idea how the situation can be explained more clear. Dropbox doesn't make difference between text based files and binary files! The content has to be uploaded as is without any change. Dropbox will save whatever you upload, as you have uploaded it, exactly (if encoded -&amp;gt; encoded)!!! That's why you cannot read it. Find a way to get to your files content non-encoded; it's the only way and usually there is such a way. For example CSV and TEXT files are... text!!! and that's why you are able see them, but PDF, DOC, and ZIP are not full text (in spite PDF and DOC are partially); in such files are least some binary pieces (non-representable as text), something that seems you cannot handle and as seems from your comment you're trying to pass in encoded form. All files you have passed (or will pass) in encoded form will not be readable. Do you understand the difference between text and binary file? Try to encode some ZIP file, locally on your machine, in base64 and see if this file will stay valid for the zip program you typically use. You can try transcode it to see if this helps. The same happens on your platform.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 10:32:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698484#M31192</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-07-13T10:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698502#M31195</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790"&gt;@Здравко&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;When I am trying to upload CSV and TEXT with same approach it is working but for PDF and other files which aren't text it is not working.&lt;/P&gt;&lt;P&gt;You mean for PDF I need to decode the data I am getting?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 12:44:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698502#M31195</guid>
      <dc:creator>Anonymous One</dc:creator>
      <dc:date>2023-07-13T12:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698511#M31199</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1724855"&gt;@Anonymous One&lt;/a&gt;, I serious doubt you don't understand the meaning of the term 'encoding'. More precisely the fact that this word meaning can vary depending on what's going work on about. Ok, I will try summarize in brief. A file is place where some data can be stored (any type of data; depending on this type, corresponding file type is assigned). Example data (and corresponding file type(s)) are text, image, archive, etc. All files (as everything digital) keep inside themself some sort on different numbers. When we're talking for text (all kind of text), file keep a sequence of number representing particular sequence of glyphs. The map that represent matching between numbers and glyps is called text encoding. All files (including text and binary) can be represented in different forms (when desirable). Their original form is called raw form. For example, if you want to ensure that particular file can be passed through a text stream, the number sequence representing file can be mapped to other sequence and vice versa. Such an example is base64 encoding. These are 2 completely different types of encodings!!! As seems you cannot make difference between and think for them as for a single thing - something erroneous!&lt;/P&gt;&lt;P&gt;Again, Dropbox expect the file's raw form either binary or original text encoding.&lt;/P&gt;&lt;P&gt;Let's hope this sheds additional light.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 13:07:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/698511#M31199</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-07-13T13:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/741636#M32733</link>
      <description>&lt;P&gt;I run into the same issue. Any solution?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2024 01:32:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/741636#M32733</guid>
      <dc:creator>yekai426</dc:creator>
      <dc:date>2024-01-07T01:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/741677#M32735</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1791861"&gt;@yekai426&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I run into the same issue. Any solution?&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1791861"&gt;@yekai426&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Which one issue? &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; If you mean that you don't know how to get to raw file content (either text or other one), that's not a Dropbox API issue - ask your platform support or read their documentation. You'll get as a file whatever you provide as HTTP request body, neither more nor less (including if you put it encoded, then the file'll be encoded too in the same way). Pass the file content as is (one to one) - the only Dropbox API related requirement.&lt;/P&gt;&lt;P&gt;If you have some Dropbox API related question, please clarify exactly what you mean.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2024 13:21:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/741677#M32735</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2024-01-07T13:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/741699#M32736</link>
      <description>&lt;P&gt;&lt;A href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1724855" target="_blank" rel="noopener"&gt;@Anonymous One&lt;/A&gt;, &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Have you found solution for your issue? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2024 19:05:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/741699#M32736</guid>
      <dc:creator>yekai426</dc:creator>
      <dc:date>2024-01-07T19:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/754797#M33041</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1802415"&gt;@graceturner&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Before uploading, make sure to read the binary data of the file and encode it using Base64 encoding. Then, send the encoded data through the API. ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1802415"&gt;@graceturner&lt;/a&gt;, don't push others here to confusion! Your statement is definitely NOT true, in spite in use by some environments. Dropbox API doesn't encode/decode/transcode the data in any way (neither on sending nor on receiving) that's why all data need to be raw/unencoded, so encoding in base64 would broke them. When they are encoded internally by the environment in use (like here), data must be decoded before send (not after - not on receiving - something that's not supported)!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 14:13:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/754797#M33041</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2024-03-04T14:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file into Drop Box From NetSuite Using SuiteScript.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/757614#M33134</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1802415"&gt;@graceturner&lt;/a&gt;, here Dropbox API is on focus, not something else! If you have question or advice to another things,... post them on corresponding place. Your postings are completely unrelated to Dropbox API.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 07:45:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Upload-file-into-Drop-Box-From-NetSuite-Using-SuiteScript/m-p/757614#M33134</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2024-03-15T07:45:57Z</dc:date>
    </item>
  </channel>
</rss>

