473,396 Members | 1,996 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,396 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 3834

"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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.