4

As is disabled on Android, is it possible to upload a photo from library, in Browser somehow? Camera/Photo Library JavaScript API?

Thanks

2 Answers 2

4

The webkit browser in version 2.2 (Froyo) supports file uploads via the typical HTML form mechanism:

3
  • 1
    I think this answer is not acceptable, given the Android fragmentation. Compatibility is, I believe quite important, and we'll have to wait some time before it's really available to Android users. Besides, almost no actual phones has Froyo yet.
    – Savageman
    Sep 3, 2010 at 18:19
  • A number of the Verizon Android phones do have 2.2, mine (an HTC Incredible) included. And, I tested file uploads on it. That said, I completely agree that compatibility is important, however, I don't presume to know elado's situation. It's possible that depending on Froyo is better than no solution at all.
    – Alan M.
    Sep 6, 2010 at 20:17
  • well, as of this comment 28.7% of Android installations are currently running Froyo: developer.android.com/resources/dashboard/… Sep 22, 2010 at 1:21
-1

I'm not sure if there is a specific place you want to upload pictures to, but I just wrote an app that does this. It uploads to Flickr and works with Android 1.6. Take a look at http://www.flickr.com/services/api/

Multi-part POST is the tricky part, and to do that you need to include apache-mime4j-0.6.jar and httpmime-4.0.3.jar.

        MultipartEntity mp = new MultipartEntity(
            HttpMultipartMode.BROWSER_COMPATIBLE);
    for (String key : params.keySet()) {
        try {
            mp.addPart(key, new StringBody(params.get(key), UTF_8));
        } catch (UnsupportedEncodingException uee) {
            // UTF-8 is always supported
        }
    }
1
  • question is about browser functionality, not native apps.
    – broofa
    Nov 11, 2012 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.