Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the android web browser allow uploading photos just taken from camera?

One of the crucial requirements in the application I am writing is that user being able to upload (input type="file") a photo from within a form.

Does the android web browser support File Uploads? If yes do all versions 1.5+ support it?

like image 502
Dynamikus Avatar asked Jul 04 '11 09:07

Dynamikus


3 Answers

You can use this:

<input type="file" name="photo" accept="image/*" capture="camera">

The important thing is

capture="camera"

EDIT: as per lastest spec capture is a boolean attribute

like image 158
bullgare Avatar answered Oct 11 '22 15:10

bullgare


Yes and no. Some people seem to have problems doing so (as outlined in the comments). Although it worked for all my devices, it's entirely possible that a different browser might not at all implement this feature.

The user can however not upload any file on the SD Card, but Audio-, Video- and Image-Files that are on the internal/external storage. The kind of files you can upload depend on the installed applications. If you have a File-Manager installed (or shipped with the OS), you can also use it to upload any file you want (Gallery and Mediaplayer should always be present).

When the upload-button of a <input type="file"> is pressed, browsers seem to send the Intent.ACTION_GET_CONTENT-Intent, so every application listening to this is a possible file-source.

like image 22
Lukas Knuth Avatar answered Oct 11 '22 15:10

Lukas Knuth


The correct format for Device API HTML input is:

<input type="file" name="photo" accept="image/*;capture=camera"></input>

This is supported by devices with Android 3.0 (for tablets) or Android 4.0 and later (for phones). I have no idea which version of iOS starts to support this.

like image 20
Will Avatar answered Oct 11 '22 15:10

Will