Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Anonymous One
3 years agoExplorer | Level 4
Upload file into Drop Box From NetSuite Using SuiteScript.
Hi,
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 upl...
Anonymous One
3 years agoExplorer | Level 4
- the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
- the full text of any error or unexpected output
(see my below reply in response to you query for uploading PDF)
1st try
let pdfData = file.load({
id: 'file cabinet file id'
}) // this will load the file
let dataContent = pdfData.getContents() // this will fetch the content of the loaded file.
let apiHeaders = {
"Authorization": `Bearer ${API_TOKEN}`,
"Dropbox-API-Arg": `{"path":"/Item Fulfillment/${pdfData.name}",
"mode":"add",
"autorename":false,
"mute":false
}`,
"Content-Type": "application/octet-stream"
} // header for the Drop Box API request
let responseData = https.post({
body: dataContent ,
url: API_URL,
headers: apiHeaders
})
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'.
Note - I tried same approach to upload CSV and TEXT file it worked but not working for files like PDF,DOC,ZIP etc.
2nd try
let binaryData = encode.convert({
string: pdfData.getContents(),
inputEncoding: encode.Encoding.BASE_64,
outputEncoding: encode.Encoding.UTF_8
});
(Here I tried same approach as above but tried to encode the data content and then sent it to DROP BOX)
Response - Got code 200. I was able to the open the PDF file but it was blank.
yekai426
2 years agoExplorer | Level 3
I run into the same issue. Any solution?
- Здравко2 years agoLegendary | Level 20
yekai426 wrote:I run into the same issue. Any solution?
Hi yekai426,
Which one issue? 🤔 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.
If you have some Dropbox API related question, please clarify exactly what you mean.
- yekai4262 years agoExplorer | Level 3
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!