Possible Duplicate:
Clearing <input type='file' /> using jQuery
This is my code:
<input ID="fileUpload1" runat="server" type="file" style="width:275px; position:absolute; left:1px"/>
I’ve try some solutions:
$("input[type='file']").val('');
$('#DivfileUpload').replaceWith("<input class=VWButton ID=fileUpload1 runat=server type=file style=width:275px; position:absolute; left:1px/>");
and many others from the web but no succeed.
You cannot set the value of a file input for (obvious) security reasons.
If you want to clear it, you need to reset the form it is in.
Replacing it with a new one should also work, but do it with valid code. (which means don’t try to include server side code such the ASP
runat=serverattribute/value and do quote attribute values that aren’t plain words (e.g. your style attribute)).