2021-12-25, 01:55 AM
(This post was last modified: 2021-12-25, 06:16 PM by mrdeltoid. Edited 19 times in total.)
As it currently stands, I'm prompted with Camera, Documents, Camcorder and Voice Recorder on my version of Android when tapping the drag-and-drop box. Needless to say, this is a problem. In order to share my screenshot, I had to open the image, email it to myself, open it on my desktop and upload it. I could not navigate to the screenshot on the Android device itself because the file system or Gallery weren't options. This is something I fixed on earlier versions of MyBB, before the drag/drop box was a thing, by specifying an accept attribute for the browse button/input, like below:
<td class="trow1"><strong>New Attachments (up to 40 files):</strong> <input type="file" name="attachments[]" accept="image/*" size="30" class="fileupload" multiple="multiple" />
It looks like I'll need to edit post.js within the /jscripts/ folder. Can someone tell me where and how to attach this attribute to the "Click or drop some files here to upload" box? This is what I found within post.js:
Post.fileInput = $("input[name='attachments[]']");
That's on line 4. What should I add to set the input to accept only images? An addition like this should fix the Android issue (showing Documents or Camcorder instead of giving me an option to browse the Gallery or file system as a whole).