views:

140

answers:

2

Can any one pf you please tell me how to clear the File upload control value using javascript.

A: 
function ClearFileUpload() { var fil = document.getElementById("FileUpload1"); fil.select(); n=fil.createTextRange(); n.execCommand('delete'); fil.focus(); }

susanthosh
A: 

Due to security reasons there is no direct access to the value of a file upload control on the client using javascript.

What you could to is deleting the element out of the dom and recreating it. Have a look at this link for an example

Andre Kraemer
we canm clear the file upload control text field. Try the code given in the next answer. I have achieved my expectation through that script.
susanthosh