I want to write a php script to download some files(extensions - .apk, .dcm, .pdf, .zip etc...) on mobile browsers. I have written a php code to download those files and it is working fine on all the browsers(not mobile browsers). But I tried it using a HTC mobile and it is trying to open the file instead of downloading(like opening a web page).
How can I enable the download on mobile browsers?
Thank You
PS: This is how I do it. I use a jquery code to send some parameters to a php file and it will return the appropriate download file path.
jQuery code snippets is:
$.post('saveData.php',{ name: name.val(), email: email.val(), phone:phone.val(), address:address.val(), version:vers, swVersion:swvers, type:type },
function(data)
{
var links = data;
document.body.innerHTML += "<iframe src='" + links + "' style='display:hide;' ></iframe>";
});
"links" variable contains the download path return from the php file. Iframe allow the download window to popup. But it does not work on the mobile browsers.