
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML File Input Control Capture and Accept Attributes Issue
Use the accept attribute to set the types of files that the server accepts in HTML. Use the attribute only with <input type="file">.
Example
You can try to run the following code to work with the accept attribute:
<!DOCTYPE html> <html> <head> <title>File Upload Box</title> </head> <body> <form> <input type = "file" name = "fileupload" accept = "image/*" /> </form> </body> </html>
The capture attribute is a boolean attribute that, if specified, indicates that the capture of media directly from the device...is preferred.
The capture attribute is NOT used to include the camera option in the dialog but to indicate that direct capture from the webcam is preferred.
The "correct" code is given below
<input type = "file" accept = "image/*">
Advertisements