clear the value of the ASP.NET FileUpload Control
This article explains clearing the value of the ASP.NET FileUpload Control pragmatically
FileUpload is readonly and its a security issue that you cant access files unless the user selects them.
You cant set the value to that file upload control explicitly
sometimes we need to clear the value of fileupload control value programatically.
first i tried like this in javascript,but i am not able to clear the value.
document.forms[0].FileUploadControl.value = "none";
or
document.forms[0].FileUploadControl.value = "";
but the right solution to clear the value of file upload control is
function remove(control)
{
var who=document.getElementsByName(control)[0];
var who2= who.cloneNode(false);
who2.onchange= who.onchange;
who.parentNode.replaceChild(who2,who);
}
u just pass ur fileuploadcontrol id to the above function. Happy Programming