Visual Basic .NET » Windows Registry and File I/O
How to Clear html fileupload browse button Value.(Urgent) -- Daya Shankar --

Hi Team,

How to Clear the browse button value in client side or javascript it seems very easy,i am using .net2005 in my web application It i very urgent need.
Thanks in Advance

-- BabuLives --


Hi Daya...

Sorry for the late reply..

try this...i hv used the same in my proj..it works for me..

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

Regards,
Satheesh

-- Daya Shankar --

Hi Babu,
Thanks a lot, Do you know how to find a size of the image file client side.
if i select more than 4 MB file my asp.net web page will crash, i want restrict the file size in some extent.please suggest me how to do.
Thanks in Advance
On 7/3/06, BabuLives wrote:


Hi Daya...

Sorry for the late reply..

try this...i hv used the same in my proj..it works for me..

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

Regards,
Satheesh
>


 

-- BabuLives --


Hi Daya,

Its better to check the file size in Server side.or else try this code am not sure whether it will work..
function getsize()
{
var oas = new ActiveXObject("Scripting.FileSystemObject");
var d = document.getElementById("FileUpload1");
var e = oas.getFile(d);
var f = e.size;
alert(f + " bytes");
}
Regards,
Satheesh

[Submit Comment]Home