'Facebook built in browser w/ input file
currently we have a html page, contains misc fields + an
<input id="test_file" type="file" accept="image/*">
The android users when browsing via any browser can select a file (id=test_file), when we post the link on a facebook post and then click it, opens facebook internal browser, when click the button (id=test_file) nothing happens!
Any solution for this?
references
Solution 1:[1]
Try to remove the accept attribute from the input file.
So my solution was to detect if its a native FB browser, and remove that attribute:
let isFacebookApp = function () {
let ua = navigator.userAgent || navigator.vendor || window.opera;
return (ua.indexOf("FBAN") > -1) || (ua.indexOf("FBAV") > -1);
};
if (isFacebookApp) {
$('#myinput').removeAttr('accept');
}
Solution 2:[2]
I'm trying to solve this issue right now. Even i I remove the accept attribute, the upload field does not work: the field appear as not clickable.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Diogo Gomes |
| Solution 2 | fmortara |
