In my application, I am handling the insert of data into the database in the "afterDialogValidate" function. I know that the automatic method for inserting the data into the database works fine.
My question is how to insert the uploaded file into the database using the manual technique.
My UX component has the following controls:
Title (txtbox)
File Upload/Download (ID: FILEUPLOAD_1)
txtAttachmentDescription (txtbox)
txtAttachmentType (txtbox)
I my "afterDialogValidate" function, I am using the following code to insert the data:
DIM cn as sql::connection
DIM args as SQL::Arguments
DIM cSQL_Insert as C
args.Set("WHATguid",api_uuidcreate())
args.Set("WHATtitle",e.dataSubmitted.title)
args.Set("WHATattachmentdescription",e.dataSubmitted.attachmentdescription)
args.Set("WHATattachmenttype",e.dataSubmitted.attachmenttype)
args.Set("WHATattachment",e.dataSubmitted.FILEUPLOAD_1)
cSQL_Insert = "INSERT INTO tablefiles (guid, title, attachmentdescription, attachmenttype, attachment) VALUES (:WHATguid, :WHATtitle, :WHATattachmentdescription, :WHATattachmenttype, :WHATattachment)"
(At this point I execute the query with the proper error trapping...)
The issue I am having is when I am trying to set the arg to the uploaded file.
args.Set("WHATattachment",e.dataSubmitted.FILEUPLOAD_1)
It gives me an error saying that it cannot find the "e.dataSubmitted.FILEUPLOAD_1". i.e. it can't find the actual file that is uploaded that I will be inserting into the database.
How do I get the actual uploaded file info and submit it to the database?
My question is how to insert the uploaded file into the database using the manual technique.
My UX component has the following controls:
Title (txtbox)
File Upload/Download (ID: FILEUPLOAD_1)
txtAttachmentDescription (txtbox)
txtAttachmentType (txtbox)
I my "afterDialogValidate" function, I am using the following code to insert the data:
DIM cn as sql::connection
DIM args as SQL::Arguments
DIM cSQL_Insert as C
args.Set("WHATguid",api_uuidcreate())
args.Set("WHATtitle",e.dataSubmitted.title)
args.Set("WHATattachmentdescription",e.dataSubmitted.attachmentdescription)
args.Set("WHATattachmenttype",e.dataSubmitted.attachmenttype)
args.Set("WHATattachment",e.dataSubmitted.FILEUPLOAD_1)
cSQL_Insert = "INSERT INTO tablefiles (guid, title, attachmentdescription, attachmenttype, attachment) VALUES (:WHATguid, :WHATtitle, :WHATattachmentdescription, :WHATattachmenttype, :WHATattachment)"
(At this point I execute the query with the proper error trapping...)
The issue I am having is when I am trying to set the arg to the uploaded file.
args.Set("WHATattachment",e.dataSubmitted.FILEUPLOAD_1)
It gives me an error saying that it cannot find the "e.dataSubmitted.FILEUPLOAD_1". i.e. it can't find the actual file that is uploaded that I will be inserting into the database.
How do I get the actual uploaded file info and submit it to the database?
Comment