0

I'm developing a mobile application using phonegap. I have a feature in one of the pages that allows a user to upload or take an image. I'm using input type image/* with capture and it works fine if you open the page on the phone through a web browser but once opened inside the application, it turns into file browser and doesn't allow for camera to take a new photo.

Anyone got any ideas what the problem is?

<table border="0" cellpadding="3" cellspacing="1">
<form enctype="multipart/form-data" action="mob_create.php" method="post">
    <tr>
        <td width="150">Date:</td></tr><tr>
        <td><input type="date" name="inputDate" value="" /> </td>
    </tr>
    <tr>
        <td>Entry:</td></tr><tr>
        <td width="300"><input size="34" type="text" name="inputEntry" value="" /></td>
    </tr>
    <tr>
        <td width="150">Add an image (Optional):</td></tr><tr>
        <td><input type="file" name="inputPic" accept="image/*" capture ></td></tr>
    <tr>
        <td><input type="submit" name="submit" /></td>
    </tr>
</form>

Phughes
  • 77
  • 2
  • 12

1 Answers1

1

input type file does not work with androids webview (it works on ios). to get images / videos you have to use the Camera Plugin

  • Thanks for this but it doesn't work as the HTML file is on the server. In the application, I have a login performed in PHP and the re-direct then goes to the server, where all the rest of the files are stored. This is where neither input picture, nor Capture photo, works. – Phughes Mar 30 '14 at 21:24
  • 1
    so, in your app, you only start some website with inappbrowser? you won't make it work then if you want to use native stuff. – Marcin Mikołajczyk Mar 30 '14 at 22:49