Trying to create an upload form in a suitelet runn...
# suitescript
n
Trying to create an upload form in a suitelet running external to add files to file cabinet. Using File API I'm not sure how to pass the contents to do a file.create in the suitelet. Anybody else try this before?
b
The object retrieved in the suitelet is already a File object
Set the folder and save it
n
@battk it’s a form that posts to the suitelet and then would create the file. But not sure what to pass from the form.
Here is the post to the suitelet and the on change before that to grab the file data
b
data posted to a suitelet is available in the onRequest entry point
specifically in the ServerRequest found within params.request (https://system.na0.netsuite.com/app/help/helpcenter.nl?fid=section_4407987288.html)
if you want the specific key on the ServerRequest, you are looking for files (https://system.na0.netsuite.com/app/help/helpcenter.nl?fid=section_4314805947.html)
that said, im not sure if what you have in your code is enough for NetSuite to generate a file for you. Files are generally handled though a file type field generated by N/ui/serverWidget
n
@battk okay I got ya. Any thoughts or ideas on a way that might work for this?
b
you can try seeing if your file is somewhere on the ServerRequest.parameters, or ServerRequest.parameters
n
Okay thanks for the help @battk
b
but generally your best bet is to use the suitelet to generate a form using N/ui/serverWidget