Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

input type='file' not working in instagram in-app browser

When you try to upload a file using input type='file' on a webpage that is opened in the instagram in-app browser, the page just reloads. In facebook in-app browser there is no such problem.

like image 866
Oleksii Lyhun Avatar asked Jan 09 '18 10:01

Oleksii Lyhun


1 Answers

Just in case this will still be useful to somebody, I had a similar problem, except in my case when I clicked on a "choose file" button nothing happened at all. I fixed it by changing the accept attribute of the button to contain only mime types and not extensions.

So this:

<input
  type="file"
  accept=".jpg,.png,.svg"
/>

Should be replaced by this:

<input
  type="file"
  accept="image/jpeg,image/png,image/svg+xml"
/>

This is very confusing because the first version works in all other browsers and docs at MDN also mention that it is correct.

like image 139
jetpackpony Avatar answered Oct 27 '22 07:10

jetpackpony