Has anyone solved the mystery around uploading fil...
# suitescript
t
Has anyone solved the mystery around uploading files to Box via Suitescript? I'm having to manually assemble the multipart/form-data and pass in the contents of a PDF file. While I can get the PDF file to generate in the Box folder, its contents are not being interpreted properly. Everything I've read so far leans towards accomplishing this outside of NetSuite. I'd rather do it from Suitescript, if possible.
j
We tried for ages and never solved this for PDFs (other file types we could do it). Instead, we use SuiteScript to email them to the box folder.
we wrote our own Box module for interacting with the Box API, and one function is
getBoxFolderForNetSuiteRecord()
which gets (or creates, if not yet existing) the associated folder, and returns the id AND email address of the folder. Then we use N/email to send an email with the file as an attachment.
t
Interesting. I'll have to try that and see if the logistics work cleanly. I see it notifies the sender as well as the folder owner. That could potentially be an issue.
j
it’s fucking annoying that it does that and there’s no way to disable it.
😆 1
you could potentially email from a generic user you have in NS that is not a monitored mailbox, to a folder owned by a similar generic user, then use the Box API to move the file.
t
I can imagine. I'll have to see if the juice is worth the squeeze.