Clear File Input Using Javascript
A useful javascript function that allows you to clear the value of a file input field.
<html>
<head>
<title>Clearing File Input Values</title>
<script type="text/javascript">
function clearFileInput( id )
{
var elem = document.getElementById( id );
elem.parentNode.innerHTML = elem.parentNode.innerHTML;
}
</script>
</head>
<body>
<form method="post" enctype="multipart/form-data">
<input type="file" name="myFile" id="fileInput1" />
<input type="submit" name="s" value="Upload" />
</form>
<a href="javascript:clearFileInput( 'fileInput1' );">Clear File Input Value</a>
</body>
</html>
http://www.netlobo.com/clear-file-input.html