@webrobert It seems a pragmatic solution. I have one concern though, the file size. Definitely, base64 encoding will increase the file size.
As you mentioned that 20-50 documents, do you know exactly what kind of content would be inside the file?
Ok, back on my contract project. Where we are now building the document, sending it to third-party (docusign) where it gets signed/executed, then will save the final pdf to a disk. The desired format is base64pdf (for the third-party send)
What I am thinking is as each document is being made (dispatch a job) we will save the base64pdf to a column... (s0 when we are ready to send the document set to the third-party, we don't have to make 10 pdfs), once the document set is sent, we just wait for a webhook from the third-party confirming the document has been executed. we will clear the base64 column and add the file path.
// documents columns
"ps_transaction_id" => 1
"name" => "Standby loan agreement"
"slug" => "standby-loan-agreement"
"values" => [] // don't judge me.
"base64" => ""
"path" => ""
...
I don't expect we'll ever have more than 20-50 documents in base64. Is the ok? Is there a more efficient, better, healthier way [to store those base64 pdfs]?
@webrobert Storing clobs/blobs in the database is not a good solution in my opinion, it will increase the table size, and if you do a lot of inserts and deletes, the table files will become fragmented on the discs, and will have large areas of unsued space instide the table.
A better solution would be to store the files in a drafts directory, and then move it to a final directory when it is finalized.
Using a mongodb like @jlrdw suggests is another option, but I would stick with using the file system.
Please or to participate in this conversation.