Hey everyone,
I have 2 related questions.
1. I have a dynamic page that shows the profile of people looking for a job. So when employers come to this page they can easily see who is looking for a job. If they click the resume button I just want another page to open with the resume. In the team database i have the file type as document.
If the uploaded document is a pdf it works fine. But if the uploaded document is a word document it triggers a download. Is there anyway to make a word document open and not download?
![](https://static.wixstatic.com/media/a27d24_e62ff1039f9144768aad735c83cc583d~mv2.jpg/v1/fill/w_980,h_424,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/a27d24_e62ff1039f9144768aad735c83cc583d~mv2.jpg)
2. In the intake form were job seekers upload their info, i have an upload button and its field type is set to accept documents only. Ideally I would like only pdfs. Is there anyway to convert any file the user wants to submit into a pdf. File types like .doc .jpg .png. Bascially I want to convert everything to a pdf. Maybe onBeforeSave()?
Thanks in advance.
Hey thank you for this. For #1 good to know. I would still be looking for solutions.
For #2 as a temporary solution I may check that the file ends in .pdf but what I find is that users have their file in many different formats, so my registration process would have less sticking points if I just accepted whatever they had to give. Is there pre-witten wix code for converting any file type to pdf anywhere. That you know of?
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.