nie działa bo jak ktoś nie umie nawet dobrze skopiować kod to jak ma działać?
Jest to kod ze strony którą podałem w 2 poście.
Kod
<INPUT name=file1 type=file id="file1" onChange="imgLoad()" >
Kod
function imgLoad()
{
var strT = new String();
document.getElementById("ShowImg").innerHTML= "";
strT = document.ModReg.file1.value;
if(strT != "")
{
strT = "<img;id='Sample' src='" + strT + "' width='100' height='100'></img>";
document.getElementById("ShowImg").innerHTML= strT;
if(!LimitedSize())
{
alert("File Size is more than 100 KB");
document.getElementById("ShowImg").innerHTML= "";
}
}
}
function LimitedSize()
{
var i;
var y = document.images;
for (i=0;i<y.length;i++)
{
if((y[i].id) == 'Sample')
{
if(y[i].fileSize > 102400)
return false;
}
}
return true;
}
oczywiście kod trzeba sobie przerobić wedle własnych potrzeb.