hantz
09-27-2007, 11:18 PM
i can't find any script that limist all kind of files before uploading...
i mean if you choosing a file to upload and it is more than the size you was gicen the javascript tells you that you can't choose this file and resets the field...
i found that one! and it's realy good but only for images...when you try to upload a regular file it will let you...
come on people there is got to be a way(not activeX) to check size of files like txt and doc!
<form name="formData">
<input type="file" name="uploadfile" onchange="setdumy(value)">
</form>
<img style="visibility:hidden;position:absolute;" id=dumy onload="checksize()">
<script language="javascript">
function setdumy(file)
{
dumy.src=file;
}
function checksize()
{
if (dumy.fileSize>51200)
{
formData.reset();
alert("fileSize should be less than 50K!");
}
}
</script>:confused:
i mean if you choosing a file to upload and it is more than the size you was gicen the javascript tells you that you can't choose this file and resets the field...
i found that one! and it's realy good but only for images...when you try to upload a regular file it will let you...
come on people there is got to be a way(not activeX) to check size of files like txt and doc!
<form name="formData">
<input type="file" name="uploadfile" onchange="setdumy(value)">
</form>
<img style="visibility:hidden;position:absolute;" id=dumy onload="checksize()">
<script language="javascript">
function setdumy(file)
{
dumy.src=file;
}
function checksize()
{
if (dumy.fileSize>51200)
{
formData.reset();
alert("fileSize should be less than 50K!");
}
}
</script>:confused: