Solved
How to upload a file from a form and save to database
I want to upload the file and save it into the database in integer form. How can I do it?
I want to upload the file and save it into the database in integer form. How can I do it?
Hi shrutij9485,
Please try below code. It will save the document in documents folder and document ID to database table
a!formLayout(
label: "Form",
contents: {
a!cardLayout(
contents: {
a!fileUploadField(
label: "File Upload",
labelPosition: "ABOVE",
target: cons!PDS_DOCUMENT_FOLDER,
value: ri!Document.documentId,
saveInto: a!save(ri!Document.documentId, save!value),
validations: {}
)
},
height: "AUTO",
style: "NONE",
marginBelow: "STANDARD"
)
},
buttons: a!buttonLayout(
primaryButtons: {
a!buttonWidgetSubmit(
label: "Submit",
saveInto: a!writeToDataStoreEntity(cons!PDS_DATASTORE_DOCUMENT_CONSTANTS,
ri!Document,
"Success",
""),
submit: true,
style: "PRIMARY"
)
}
)
)Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.