Force PDF download instead of showing in a tab

Hello there,

Does anyone know if there is anyway to force the download of a PDF that´s been already stored on Bubble to download instead of showing it in another tab?

I´m using SelectPDF and to show the PDF you´ve to put in the workflow the “open in another website” but it would be nice to force the download.

Thanks a lot.

Here’s a link that may be handy.
We have that in one of our apps, and with a bit of trial and error it does work.

Thanks @vladlarin,

I´ve tried but it does not work. The problem is that in the workflow (see the image below) I create the PDF and then it has to go to the URL where the PDF is stored.

Is there anyway to solve this situation?

Nice post though.

Thanks a lot.

Could you let me know why exactly that does not work? What does the debugger\WF logs show?
The PDF generated should still have some URL associated with it, from what I understand.

So the link should work (if set up correctly).
I faced the thing that you may need to add http(s):// in front of the link for this to work.

1 Like

It gets redirected to this URL: <a%20href="https:////s3.amazonaws.com/appforest_uf/(uniqueid)/Factura_6_2017.pdf"download<Download</a>

(uniqueid) is the id of the invoice pdf, I cannot show since there is some confidential information there.

What should I do Vlad?

Thanks a lot.

I would start with taking that URL, pasting it into your browser and understanding what you need to change in order for it to open there.
Removing some extra //// s for instance.

As soon as you get it to open in browser, adjust the formatting of the url in the wf accordingly, and it should be ok.

I’ll be able to check the formatting I’ve done for my download link a bit later and paste it here.

Hello Vlad,

I´ve done some tests removing the //// as you say, putting https, taking it away, put :encoded in base64, … but nothing.

Any other idea? hehe

Thanks a lot vlad.

Here’s how we do it (and it’s working):

<a href="http:var_your_pdf_url_here" download="var_pdf_name_here">Download</a>

Hi @vladlarin

I´ve just tried an nothing. But you do with the “Open in external website” workflow?

Look at the image below.

Bests.

Ok, I believe here you should either give the links that you are getting (with some non-sensitive data), or the link to the application here to be able to check this out further on :slight_smile: