Hi, I am looking for a way to let visitors to download the PDF files directly from the webpages to the computer through the “save as” dialog box. Is there any idea for that?
Thank you for your reply. But, unfortunately, they did not help me. I have only 1 PDF file on each webpage and I want to set the link when visitor click on that the “save as” dialog box open and visitor save the document on his computer. I don’t want they view the PDF in browser!
Thank you for your reply. But, unfortunately, they did not help me. I have only 1 PDF file on each webpage and I want to set the link when visitor click on that the “save as” dialog box open and visitor save the document on his computer. I don’t want they view the PDF in browser! In addition, I couldn’t find “download button”. could you please let me know where can i find it?
Or
Link a document to an element on your site, such as an image or button. Visitors will be able to download the document by clicking the element.
Display Google Drive documents directly on your site for your visitors to see using the Google Drive app
I actually need to use a function like this:
“saveAs(blob, filename+”.pdf");
when I click on a Document Button.
So, how can i do it for a Document Button?
Try using the code that Jeff (Wix Mod) put on a post in the forum post linked earlier:
$w.onReady(function () {
$w("#dynamicDataset").onReady( () => {
//assign the hasDoc variable the value of the field that holds the document in the current item of the dataset.
const hasDoc = $w("#dynamicDataset").getCurrentItem().docField;
if (hasDoc) { //check if hasDoc is true
$w("#button1").label = "Download"; //change button label
$w("#button1").enable(); //enable the button
}
else { //check if hasDoc is false
$w("#button1").label = "No Doc"; //change the button label
$w("#button1").disable(); //disable the button
}
});
});
And integrate the need to use a function like this: “saveAs(blob, filename+”.pdf"); into it.
You can also try these and see if they are any good for you: