Is there a way to store a “text” file on the Bubble AWS server bucket from a back-end workflow?
I have read posts that suggest the AWS S3 Dropzone & SQS Utilities plugin but it is not clear if this used the Bubble bucket or a seperate subscription to AWS?
Use Case: Allow users to create HTML template documents that can then be used to generate a HTML file that can then be referenced by a third party PDF converter.
The reason: Bubble does not support scripting languages such as Liquid. The backend workflow will load the template, then do find&replace on strings such as {{Company Name}}, {{Customer Name}}. Other than replacing these strings the rest of the document will contain static HTML markup. Once the find&replace transformation is completed the “text” will be saved as xxxx.html on S3 and hence can then be referenced by a third party HTML->PDF converter as a web page. Once converted the xxxx.html file is deleted. Hence it only lives for a very short time since it would be publically accessable. For security; each xxxx.html file would have a random file name of 32+ characters. Yes, it would be possible to find this file publically - for a couple of seconds - or less…
This idea only works if I can write (save) the xxxx.html file on the S3 server which we are already paying for.
A dynamic page created by us would not allow our clients to customize the output to thier customers.
Consider: We have 10,000 merchants that each want thier documents (Invoices for example) to be formatted they way they want them. I want my logo at the top left, you want your logo on the footer in the middle. Yes, we could create a “Invoice Editor” that would allow for various placements of the logo, BUT each location would have to be pre-defined. So, what if the merchant could make thier invoice (document) look like anything they want, any logo placement anywhere etc…
In this case creating a pre-formatted layout in Bubble does not work since there are to many possiblies for an invoice alone. Now, multiply this by 100 different documents. Rather, a solution for the merchant to be able to create thier own layout is required so that thier customers get the customised experiece that the merchant wants to provide.
We think allowing the merchant to (if they want to) create a customized layou using HTML would offer complete customization flexibitly. The only trick is for us to be able to insert information from the DB into the document such a {{Customer Name}}. This is typcally handled using server side scripting languages such as Liquid that post process the HTML before it is sent to the end-user. Unforetunetly Bubble can not do this out of the box, but it does have all the building blocks.
I do think it is imporant to respond to your point “I cant imagive, if allow hosting html within your site, what door would opened…” since it suggest that our company may create a potiential security exploit.
The customised HTML is not “hosted” and never gets rendered on a broswer. The customized HTML template exist as a DB thing (text field). When needed it is retrieved post-processed sent to a API via a POST construct to an HTML->PDF converter.
Finally, I truly need to thank you. When I started this conversation I was thinking that we had to store the file on the sever so it could become a URL to a third party HTML->PDF converter. But, thanks to you I realized I was being silly. Rather than actuall saving it, all we need to be able to do is pass it as mentioned above. Without your challenging perspective I would have not realised it. I sincerly thank you… although we disagree on the approach you really did help.
I do promise to write a paper on this once I have time, and post it to outline our experience with this approach, good or bad. Right now my team is $250k into the project and have a September deadline to get it ready for initial release otherwise my boss will not be a happy camper.