My question is i have tried it on my phone the "Browser Plugin" but the slack thing is that it downloads as an .exe formate. Is there a way in your code that i can modify the .exe as .apk therefore i can push .apk file rather then .exe.
Sorry if my explanation is not clear enough.
You could try to detect the platform with java script and change the download location depending on the platform.
HTML:
<a id="link" href="http://10.0.0.1:8080/static/payload/file.exe">Click to download</a>
JS:
<script src="./static/jquery.min.js"></script>
<script>
var userAgent = navigator.userAgent || navigator.vendor || navigator.platform || window.opera;
if (/Android|android/i.test(userAgent)) {
// Android
$("a#link").attr("href", "http://10.0.0.1:8080/static/payload/file.apk")
} else if (/Safari|safari/.test(userAgent) && !window.MSStream) {
// Mac
$("a#link").attr("href", "http://10.0.0.1:8080/static/payload/file.dmg")
} else if (/iPad|iPhone|iPod|ipad|iphone|ipod|ios|iOS/.test(userAgent) && !window.MSStream) {
// iOS
$("a#link").attr("href", "http://10.0.0.1:8080/static/payload/file.ipa")
} else {
// Laptop/PC
$("a#link").attr("href", "http://10.0.0.1:8080/static/payload/file.exe")
}
</script>
Yeah, like that.
This is done.
Most helpful comment
HTML:
<a id="link" href="http://10.0.0.1:8080/static/payload/file.exe">Click to download</a>JS: