I am using the plugin "InAppBrowser" from Cordova, I am passing in a url from my website, the page is showing fine but when I try to upload something on my website, the upload popups are not showing up in the mobile but when accessed from the website, it works fine.
It is a sinple html input field as:
<input id="upload1" type="file" value="" name="coverimage" /></div>
Any idea why it does not work? It looks like the popups are blocked.
Here is my code:
Thank you for your help,
Your mobile app is not being served by your web site, you have to actually put together a RESTful API to talk to your web site and use AJAX to send files to your server. See this article for some explanation > https://www.raymondcamden.com/2012/05/05/converting-a-dynamic-web-site-to-a-phonegap-application/ < written by a longtime PhoneGap and Cordova developer.
You mobile device does not have the same freedoms as the browser on your desktop or laptop. For security and privacy reasons, apps have very restricted access to the mobile filesystem. You cannot treat a mobile app like a web site, it's not the same thing. In addition, apps that are simply pointers to web sites tend to get very low ratings and are banned from some stores. Your app should be something that works with your site, not just a simple mirror of your site, for that you can add a desktop icon to simply open your site in the device browser.
Cordova apps use HTML5 to create apps, so it is a way to use your HTML5 programming skills to write an app. It is not a mechanism to simply wrap up a web site in an app. Hope that helps.
Thank you for the reply. I now understand the security reasons.
I do program in PHP, not at an expert level but well enough to build front and backends. I would like to know something please, lets say I build an app in html5 that requires a login into my website database(mysql), how complicated would it be please?
How can the server on my website can communicate via PHP with the android app for example?
Everything should be done via a RESTful API. You cannot include PHP scripts either embedded or as explicit files in your app; because your app pages are not being "served" by a web site there is no PHP server to interpret them, and there is no "hard connection" between your web site and your app, they are really independent entities.
Login is a difficult thing, you might want to consider adding something like OAuth2 to your web server for login, since there are lots of good Cordova plugins to work with that authentication.