Determine the file size in the client [ie]
Function getFileSize ()
{
Var filename = document.All.file.value;
IF (filename == '')
{
Return False;
}
Try
{
VAR ado_stream = new activXObject ("adodb.stream");
// 1 = adtypebinary; 2 = adtypetext
ADO_STREAM.TYPE = 2;
ADO_STREAM.Open ();
ADO_STREAM.LOADFROMFILE (filename); // Put the file information into the stream
Alert ((ado_stream.size / 1024) .tofixed (2) "kB")
}
Catch (e)
{
Window.confirm (e);
Return False;
}
Return True;
}
script>