25
Views
1
Comments
Using iFrame pdf content list, onclick download

I have created one web application of product list and table to download the pdf into web reactive so its downloding by using Ultimate pdf but i want the iFrame of product and table list  into the mobile application while clicking on the any list of iFrame it should download into the mobile local storage...and out side of iframe i have created one button it is downloding there is no issue.

Can someone tell me about this how to solve this problem while clicking on the iFrame of any list item it sould download into the phone local storage????

pdfff.PNG
2025-12-09 14-11-18
Janakiraman JR

Hi Prince,

OutSystems mobile apps rely on Cordova/Capacitor, which restricts automatic file downloads triggered by clicks inside iframes. Mobile browsers especially iframes to block direct access to the device’s file system. As a result, using window.open() or anchor tags with the download attribute inside an iframe is often limited or blocked on mobile devices.

If possible, please have the iframe send a message to the parent app (the mobile app wrapper) whenever a list item is clicked.

In your iframe page (the web app), add the following JavaScript:

window.parent.postMessage({ action: 'downloadPDF', productId: '123' }, '*');


Then, in the mobile screen where the iframe is embedded, handle that message with: 

window.addEventListener('message', function (event) {

  if (event.data.action === 'downloadPDF') {

    // Call a client action to download the PDF

    $actions.DownloadPDFFromServer(event.data.productId);

  }

});

In addition use a plugin like:

  • File Plugin (to save to local storage)

  • FileTransfer Plugin (to download from URL to storage)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.