9

I am using a file type input. It should accept pdf, doc and docx file formats. So I added the following input tag -

<input type="file" accept=".pdf,.doc,.docx">

This works as expected on desktop i.e. It shows only these files on file browser. But on android devices it prompts the user to select either file browser or camera. Since we are not accepting image files I want to disable the camera option. I know the user can override the accept attribute and select any file he wishes, for this I have put javascript validation. But is there any way to disable the camera option on mobile devices? I am looking for something opposite to capture="camera".

arthcp
  • 130
  • 8

1 Answers1

-3

Try:

<input id="file-upload" type="file" accept="image/*" name="file-upload" />
Or Assayag
  • 5,662
  • 13
  • 57
  • 93
  • While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. – Donald Duck Dec 28 '20 at 20:58
  • this does not solve the problem. The user wants to upload only doc/pdf files and not images. – Sourav Jul 20 '21 at 09:14
  • This is doing the opposite to what is requested. The point is they dont want to upload images. – RollingInTheDeep Feb 18 '22 at 07:21