JavaScript - O tamanho do arquivo é medido em bytes

if (s > 4 * 1024 * 1024)
    alert("Too big");
Obedient Osprey