471,596 Members | 1,093 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

how to check size of file before upload to serevr

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......

Jul 17 '05 #1
2 3752

"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
Jul 17 '05 #2
"vishal" <vi************@yahoo.co.in> a écrit dans le message de news:
11**********************@o13g2000cwo.googlegroups. com...
is there anyway that i can check the size of file on client side before
uploading file to server????


Hello,
Certainly not with php !
But perharps with Javascript.
Bye
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Joe | last post: by
4 posts views Thread by lawrence | last post: by
6 posts views Thread by nicholas | last post: by
8 posts views Thread by VB Programmer | last post: by
2 posts views Thread by yonthebeach | last post: by
3 posts views Thread by puja | last post: by
2 posts views Thread by Geoff | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.