EN
HTML - file input only for archives (zip, rar, 7z, gz)
0 points
In this article, we would like to show you how to create file input only for archives in HTML.
Quick solution:
xxxxxxxxxx
1
<input type="file" accept=".zip,.rar,.7z,.gz">
In this example, we create file input using type="file"
attribute. To make it allow only archive 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" name="archive" accept=".zip,.rar,.7z,.gz">
7
</label>
8
</body>
9
</html>