'Form should only accept PDF-file

I use the Wordpress plugin Contact Form 7 and allow users to upload a PDF-file. The input field looks like this.

<input type="file" name="file-838" size="40" class="wpcf7-form-control wpcf7-file hidden" id="myFile" accept=".pdf" aria-invalid="false" />

On my computer and iPhone I can only upload a PDF-file, but on Samsung phones (and maybe other phones) people can upload an image which should not be possible.

What causes this problem and how can I fix it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source