You can sort of fudge it with javascript, but you need to back this up
by checking the mime type of the uploaded file and throwing an error if
it's not what you expect:
<html>
<head>
<script>
function checkFile()
{
var path = document.forms[0].myImage.value;
var ext = path.substring(path.length - 4, path.length).toLowerCase();
if (ext != ".jpg" && ext != ".gif")
{
alert("You must choose an image file!");
document.forms[0].reset();
}
}
</script>
</head>
<body>
<form>
<input type="file" name="myImage" onchange="checkFile();">
</form>
</body>
</html>
-Jason
Mark Sandfox wrote:
Is there a way to restrict the user to only selecting and sending either a
.gif or .jpg. Everything I have read says this option can not be done by
design (security reasons). I find that irronic as this is the reason
(security) that I want to restrict their selection.
Any help on this one will be greatly appreciated.
The page is using ASP.NET.