Downloading PDF content in iframe with source url not having .pdf extentions - javascript

I am trying to download pdf file that is generated dynamically using python.
Inspect element iframe looks something like this.
name="detail" src="/service/displayMailStream.a?importSummaryId=513221314664&lang=en&OWASP_CSRFTOKEN=ZjI2ZTU3MTYt313123MzVhNS0xMWViLWIwNjktMDA1MDU2ODYzZDU0#navpanes=0&toolbar=1&view=fitH" frameborder="0"
The Actual URL when opening the link which has PDF content is:
https://www.postal.com/service/displayEpostInboxMail.a?documentId=51121213314664&language=en&source=myinbox&OWASP_CSRF=ZjI2ZTU3MT321312312YtMzVhNS0xMWViLWIwNjktMDA1MDU2ODYzZDU0
The pdf viewer plugin has the download button which can be clicked and pdf will be downloaded.
However is there a way for chrome to download the pdf immediately after the url is opened (Chrome PDF download automatically is set to Yes but this requires the download button to be clicked)
Additionally:
I could try to click the download button via selenium but the button cannot be accessed by ID.
Because the button is under #Document == $0.
Any one have this working ?

Related

hide toolbox from dynamically generated <iframe> in react using JSPDF

I am stuck in a situation wil creating PDF from jsPdF package.
I want to preview my PDF before it download (actually i didn't want to download the resume but preview the PDF only)
I create a tag and pass datauristring to its src attribute to open the preview in new window but I also want to hide the option header of iframe to prevent the user from downloading the PDF directly because PDF is only download on subscription base.
[image of toolbar][1]
[1]: https://i.stack.imgur.com/eaoys.png

All downloads from iframe go to folder in server

My website contains a iframe which allows the user to navigate the web. If the user clicks a download button on any website I would like it to download in a folder located on the servers itself. So if the user presses download on a image, the image is downloaded onto a folder on the server instead of the computer. Is this possible? I have no idea on how to go about doing this.
You seem to need to display a download button on any website...
You cannot modify all internet websites with your code.
The only way to go this is :
to create a browser extension, like this one : https://chrome.google.com/webstore/detail/image-downloader/cnpniohnfphhjihaiiggeabnkjhpaldj
This extension will be able to interact with any website and do what you want.
or (more simple to code) execute a Javascript of your own that will make floating a download button on any image of any website.
You can do this with this Chrome extension for example : https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
You can also use a "download" button over the iframe that launch a curl Linux command that will download the iframe page and all the images, files etc...

Must click like button before see download link (html or javascript)

I have a document download link on my website and I want everybody must click like button (facebook page), before see download link using javascript or html.

Download a pdf (not open in tab) in Javascript

I have a landing page on which there is a form which is filled by user and then it goes to a thank you page (which is another page). On thank you page I simply want to prompt the user for saving a pdf as the thank you page loads. Please note I want the file to be saved/downloaded and not opened on the same tab or another tab in the browser. I have tried multiple solutions but they all seem to open the pdf in the browser itself and not download it. Some of the methods I have tried are meta tag download, page redirect download, iframe download but they all open the pdf in browser itself and not download it. I just want a simple solution for downloading the file and not opening it in the browser. Also the pdf should download automatically without clicking any link or button.
The document.ready event of the thank you page should trigger a local script that runs a server script to download the PDF. Be sure to set the headers as described above. If you try to link directly to the PDF, it'll try to load in the browser.
Alternatively, you could create the PDF in a directory that is already set to only download files by setting the .htaccess file for that directory.

PDF to open in a iFrame instead of downloading

I am displaying the number of records using HRef along with Title, all my records are coming from the WordPress connector which are types of PDFs and WebPages. I want to have a my PDF file open in iFrame instead of downloading it. Currently when I am clicking on Href, It is asked me to start downloading.I need this using ASP.NET. I don't have even any control from WordPress connector. It is simple third party.
Simple thing is I want to open a PDF file in iFrame instead of downloading. I want this using JQuery, so when user clicks it will be loaded into the iFrame.
Harshal

Categories

Resources