"vishal" <vi************@yahoo.co.in> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
hi
is there anyway that i can check the size of file on client side before
uploading file to server????
suppose the user uploads file of 10 mb then the server will know the
size is 10 mb after the file is uploaded to server which wastes the
bandwidth so what i want to check is that the server first checks the
size of file to upload and if it is
o.k. then and then only the file will be uploaded..
thxs for reply in advance......
AFAIK, it's not possible to do this in PHP, since it's a server-side
scripting language. In other words, PHP can only find the size of the file
_after_ it has been uploaded. To check the size of the file be fore it is
uploaded, you'll need to employ a client-side scripting language, such as
JavaScript, and create a condition that the file must be under a certain
size, or it will not be uploaded.
HTH