How to make a button linked to a word document open instead of download

Hey there,

For #1, the reason that you’re able to view the PDFs is completely a feature of the browser, rather than the code itself. Chrome, Edge, Firefox all allow you to view the PDF life in the browser, before saving it to your disk.

The Wix server with the PDF (Or any other server) tells the browser that a PDF type of file is coming, and the browser then knows how to “catch” it. Same with .txt files.

These browsers don’t have a built-in reader for Word documents to allow you to view them, so the browser default is to download them. There is no Velo code that will allow you to view the Word document.


For #2, instead of converting, a quicker(but not 100% foolproof) way to do this could be to check the name of the file before you upload, to see if it ends in .pdf.

Converting is possible, but will generally require Velo Code and NPM modules such as pdfmake.