Trying to figure out the correct workflow of uploading a single PDF through the FileDropzone component to MySQL and having it be visible/downloadable via the PDF component.
Tried uploading PDFs to two MySQL column types - blob and text. I feel like blob should be the correct way, but I can't get it to work.
Blob
When reading the blob object in retool, it's a buffered array with a ton of sub-arrays.
The bin file downloaded directly from the database (phpmyadmin) has this format, which seems correct:
[{
"name":"test.pdf",
"type":"application/pdf",
"base64Data":"JVBERi0x[...]NjUT0YK",
"sizeBytes":968031
}]
Text
I can get text to upload and show in the PDF component via this link. My submit form is using {{ fileDropzone1.value[0].base64Data }}
to get just the string to the database. The PDF component is using 'File URL' with data:application/pdf;base64,{{ table1.selectedRow.proposalPDFtext }}
which seems like a hack, but it works.
I just want to confirm that the text method is sound before I code this throughout.