EN
HTML - file input only for zip
0 points
In this article, we would like to show you how to create file input only for zip files in HTML.
Quick solution:
xxxxxxxxxx
1
<input type="file" accept="application/zip, application/x-zip-compressed, multipart/x-zip">
In this example, we create file input using type="file"
attribute. To make it allow only .zip
files, we set accept
attribute to the types that file input should accept.
xxxxxxxxxx
1
2
<html>
3
<body>
4
<label>
5
<span>Choose a file:</span>
6
<input type="file"
7
name="archive"
8
accept="application/zip, application/x-zip-compressed, multipart/x-zip">
9
</label>
10
</body>
11
</html>