473,218 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,218 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 3830

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Joe | last post by:
Hello, I have IIS 6.0 running on w2k3 Enterprise. I have three upload forms 1 to have restricted uploads .asp 2 to upload plain .asp any extension 3 a FP form upload non .asp
4
by: lawrence | last post by:
Using <INPUT type"file" runat="server"> to upload a file. When the file size is too large I get a "page cannot be display" error. Thats cool I'm down with that. But is there a way to check for...
6
by: nicholas | last post by:
when I upload a file, I can set in my code not to save it if the file size is too large. But then the user has allready been waiting a few minutes to upload his file, as this can only be...
8
by: VB Programmer | last post by:
I am using a FileUpload control (ASP.NET 2.0). How do I check the length of the file in bytes BEFORE I let them upload it? I believe my code checks now AFTER... If...
2
by: yonthebeach | last post by:
hi, i have an upload mechanism on my website and want to check the filesize on the client size. is this possible? thanks yavuz bogazci
3
by: puja | last post by:
hi all, In asp.net 2.0 there is a limit on file size upload of 4MB. I know this limit can be increased in web.config file. Is there any way to check the file size before upload ? if user is...
12
by: Phil Z. | last post by:
After migrating an ASP.NET 1.1 application to 2.0 we were getting "Cannot access a closed file" errors when uploading. I found a number of post on the subject and have since moved from using an...
2
by: Geoff | last post by:
Hi Previously I was able to check for an uploaded file to be a jpg or a gif by using the exif_imagetype() function. I had to change from hosting provider and the new one doesn't want to...
4
by: bienwell | last post by:
Hi all, I developed an web page in ASP.NET to upload file into the server. In the Web.config file, I declared <httpRuntime executionTimeout="1200" maxRequestLength="400000" /> The MAX...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.