473,473 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calculate sent file size

Hi,
How can I find out what is the size of the HTML page i've sent to the
client's browser?
(Without using the server logfiles)

Roy.
Jul 19 '05 #1
8 2653
<%
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FL = FSO.GetFile(Server.MapPath("this_is_the_file.html" ))

Response.Write FL.Size

Set FSO = Nothing
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Roy Danon <ad***@droyd.net> wrote in message
news:c1**********@news2.netvision.net.il...
Hi,
How can I find out what is the size of the HTML page i've sent to the
client's browser?
(Without using the server logfiles)

Roy.

Jul 19 '05 #2
Ah, but what about when it's an ASP page that can vary in output length
based on user input?
I was going to say that you could have the page call itself with an http
request using xmlhttp, but it seems this would cause an endless loop that
your server may not enjoy.

page calls page, which calls page, which calls page, which calls page, which
calls page, which calls page....

Of course you could always have the page only call itself if the remote_addr
is not the IP of the server or something like that.

Ray at work
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
<%
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FL = FSO.GetFile(Server.MapPath("this_is_the_file.html" ))

Response.Write FL.Size

Set FSO = Nothing
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Roy Danon <ad***@droyd.net> wrote in message
news:c1**********@news2.netvision.net.il...
Hi,
How can I find out what is the size of the HTML page i've sent to the
client's browser?
(Without using the server logfiles)

Roy.


Jul 19 '05 #3
> Of course you could always have the page only call itself if the
remote_addr
is not the IP of the server or something like that.


Or pass a parameter that says "don't invoke the XMLHTTP call"... that way
you could test either from remote or local.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #4
My Mistake,

By saying "the HTML page" I ment the HTML code the ASP application
generates.
Thanks,
Roy.
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
<%
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FL = FSO.GetFile(Server.MapPath("this_is_the_file.html" ))

Response.Write FL.Size

Set FSO = Nothing
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Roy Danon <ad***@droyd.net> wrote in message
news:c1**********@news2.netvision.net.il...
Hi,
How can I find out what is the size of the HTML page i've sent to the
client's browser?
(Without using the server logfiles)

Roy.


Jul 19 '05 #5
My point here is to measure the level of traffic a groups of pages uses and
limit it at some point,
requesting the page again with couse doubled traffic which is simply a waste
of money and resources.
Roy.

"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:ea****************@TK2MSFTNGP10.phx.gbl...
Of course you could always have the page only call itself if the

remote_addr
is not the IP of the server or something like that.


Or pass a parameter that says "don't invoke the XMLHTTP call"... that way
you could test either from remote or local.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

Jul 19 '05 #6
"Roy Danon" <ad***@droyd.net> wrote in message
news:c1**********@news2.netvision.net.il...
: My Mistake,
:
: By saying "the HTML page" I ment the HTML code the ASP application
: generates.

The HTML code or the file size including any images, etc.? Do you really
want to limit or change accordingly? If the log file already performs the
calculations for you, anything else you use "is a waste of money and
resources." Using the log file, it's a simple lookup, run it each night and
if the user goes over their limit, charge them accordingly.

http://webdesign.about.com/cs/logana...oganalysis.htm

HTH...
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #7
"Roland Hall" wrote:
:"Roy Danon" wrote:
: : My Mistake,
: :
: : By saying "the HTML page" I ment the HTML code the ASP application
: : generates.
:
: The HTML code or the file size including any images, etc.? Do you really
: want to limit or change accordingly? If the log file already performs the
: calculations for you, anything else you use "is a waste of money and
: resources." Using the log file, it's a simple lookup, run it each night
and
: if the user goes over their limit, charge them accordingly.
:
: http://webdesign.about.com/cs/logana...oganalysis.htm

change = charge.
Jul 19 '05 #8
> My point here is to measure the level of traffic a groups of pages uses
and
limit it at some point,
requesting the page again with couse doubled traffic which is simply a waste of money and resources.


How many different variations of the ASP page can be sent back? Couldn't
you measure that up front?
Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
6
by: Herrcho | last post by:
in K&R Chapter 6.3 it mentions two methods to calculate NKEYS. and points out the first one which is to terminate the list of initializers with a null pointer, then loop along keytab until the...
96
by: david ullua | last post by:
I am reading "Joel on Software" these days, and am in stuck with the question of "how to calculate bitsize of a byte" which is listed as one of the basic interview questions in Joel's book. Anyone...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
1
by: William Connery | last post by:
Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an...
5
by: Michael | last post by:
Hi. I need dinamically calculate input text field based on parent static TD before showing content of input. Please, advice. Michael
11
by: Thomas | last post by:
Hi, I'm pretty new to the programming world. I got stuck in the following problem. Please guide me about it. Well I'm trying to get the value of (128^100)^2 I've used long double type but to no...
1
by: mansi sharma | last post by:
Hey Frnds to calculate the File Size everytime we have to give extension such as .txt,.doc. AS FOLL-- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)...
38
Frinavale
by: Frinavale | last post by:
I'm implementing a Silverlight application that uses Sockets to receive data that is pushed to it from a Socket Server. (Silverlight only supports the TCP protocol) The Socket Server pushes a...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.