jQuery-File-Upload
jQuery-File-Upload copied to clipboard
Selecting files does not work on Galaxy Ace and Android 2.3.6
Hi all, one of my users reports being unable to load images from his android mobile, from my logs it appears he uses Android 2.3.6:
Mozilla/5.0 (Linux; U; Android 2.3.6; fr-fr; GT-S5839i Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 )
I am not sure if I should add some specific configuration to make it degrade gracefuly for mobiles ? thank you
Precisions : Mobile:galaxy ace version android2.3.6 Version kernel2.6.35.7 Dpi@Dell 161#1 version# gingerbread.xxld2
User indicates that nothing appens upon clicking the upload button to select files. He also tried using the demo page at http://blueimp.github.io/jQuery-File-Upload/ with same results
From my last tests with the Android Emulator and an image with Android 2.3 I couldn't reproduce any problems, as stated in my reply to the referenced issue post.
One issue I am aware of is that for the file selector, Android presents not only the local files on the Android device, but also images from the user's picasa gallery, which - when selected - do nothing, i.e. no file gets selected.
Other than that, there might be an issue with that specific device, the Galaxy Ace running this version of Android 2.3.6.
In any case, since I cannot reproduce the issue with the emulator running Android 2.3 and I don't have a real hardware Android device and also not that specific device, there is nothing I can do about this.
Yeah, same here, with android picking up big time lately, we will need to get some... Tx for the advice, I will reach the user and make him provide additional feedback if possible thank you
I also see this behavior using a Windows Phone 8 Lumia 920
I can repro this issue on my Samsung Galaxy running 2.3.6.
http://caniuse.com/filereader tells us that 2.3.6 does not have FileReader support. I imagine a fallback would involve integrating something like this: https://github.com/Jahdrien/FileReader
Inside the 'loadImage' function, 'loadImage.readFile' returns false because there is no FileReader support.
In my code using this library I can get it to select a file, and upload it, but not process it in any way. To do that I'm pretty sure you'd need to implement a fallback polyfill like the one I linked there. If you're doing anything that calls loadImage, it'll just return false on Android 2.3.6.
Tried on a Droid Razr Maxx, Android 4.1.2, using default browser and found that I could take a photo with the camera and the preview would generate, but trying to pick from the gallery would not generate a preview.
Strange comparison to the Samsung Galaxy 2.3.6 where I could pick from the gallery and generate a preview but didn't even have a button (as far as I can tell) to take a photo even though the phone has a camera.
To test the differences in preview generation, you could also go to the JavaScript Load Image demo here, which also displays Exif information including Thumbnails: http://blueimp.github.io/JavaScript-Load-Image/
I have the same problem on Android 2.3.6. Also with my Tablet (SGT 10.1) which has Android 4.0.1.
Those who have an Android device where selecting files doesn't work, could you try and debug it to see what could be the issue? Also, it would be interesting if a normal HTML form file input selection works or not.
HTML Form just works fine.
Testing http://blueimp.github.io/JavaScript-Load-Image/ displays "Error Your browser does not support the URL or FileReader API".
Picking from Dropbox on my Samsung Galaxy 2.3.6 device triggers 'add' where data.files[0] is an instance of File where data.files[0].name is blank, meaning there's no way to do anything with the file, including upload it. This is also the same exact result as when you open the file picker, and then hit the native back button to cancel choosing a file.
I've done by best to inspect and debug but can't find a difference between canceling a file pick, and picking from Dropbox.
Strangely, when I was visiting with a friend using a Motorola Droid X2 running Android 2.3.5, he could choose photos from Dropbox, but could choose photos from his gallery.
If I turn off jquery.fileUpload and simply pick from the html input[type=file] element, everything works fine. I can apply a photo from Gallery or Dropbox, and they apply a filename. Opening the picker and then canceling sets the filename to blank as expected.
Any other suggestions for how I can debug this further? Somehow when "add" gets called, things are already wrong. I'm not sure where to look next.
EDIT: I'm also having an issue here where even when I do get a file selected, my server interprets the request as HTML instead of json. I've also been unable to track down how that's happening. Trying in any real browser results in the server properly recognizing the request as json.
Another note, I can pick photos from anywhere using FireFox which is available for Android 2.3. At least that gives me an option to tell my users to try FireFox instead of the stock browser. We should still be able to get file picking without previews to work in the stock browser, though.
Droid Razr M, Android 4.1.2, Chrome, choosing a file from camera says "Failed to open selected file" even when I disable the plugin and just try an html input[type=text]. Found a reference: https://code.google.com/p/chromium/issues/detail?id=176703 Looks like Chrome is just buggy.
Choosing from the gallery 'Camera' works.
Choosing from the gallery 'Messaging' I get orientation=undefined, however if I just treat it like orientation=1 it seems to do ok.
Thanks very much for your update on this issue, Glenn! I've now marked this issue as a browser bug.