i’m having one problem with the javascript code.
i set the minimum post file size
my code is:
if(f.size >= 512)
upload_file(f);
i want to set the maximum size too,then added this
if(f.size >= 512 && f.size <= 1512)
upload_file(f);
but when i test the script only the minimum size work,i upload a 245B file will return error,but i upload a 10MB picture it successfully upload,anyone know what’s wrong in the script?
Actually, your 1kB file should NOT return an error, since 1024 > 512. The file API returns filesizes in bytes.
I therefore assume there are other errors in your script, such as:
the property of the File API that returns the file size is called
size, notfileSize.