I want to upload images to my server, the upload works normally, however I want to restrict the type of file to upload, in such a way that it only allows me to select jpeg images when the file selection window opens.
I want to upload images to my server, the upload works normally, however I want to restrict the type of file to upload, in such a way that it only allows me to select jpeg images when the file selection window opens.
The accept attribute of the input tag can be used. To accept files of type jpeg, the following code can be used.
To allow any kind of images you can use the following code
accept
This attribute indicates the file types that the server accepts, otherwise it will be ignored. The value must be a list of unique content types, separated by commas:
The browser versions that support this attribute are the following: