see this site http://www.javacoder.dk:56400/fileupload/sizecount2.asp
I have 3 sites and 1 database in the database I have a tabel FilStr
On my sizecount.asp
<%
Dim aUnits, nUnit
aUnits = Array("B", "kB", "MB", "GB", "TB")
nUnit = 0
Do Until (nSize <= 1024) OR (nUnit = UBound(aUnits))
nSize = nSize / 1024
nUnit = nUnit + 1
Loop
FormatSize = FormatNumber(nSize, 2) & " " & aUnits(nUnit)
End Function
%>
This site will give me a right sizetype !!!
my db.asp
<%
Dim sConnectionString, oConnection, oRecordset, intTotalSize
sConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath ("FileDB.mdb")
Set oConnection = Server.CreateObject("ADODB.Connection")
oConnection.Open sConnectionString
Set oRecordset = Server.CreateObject("ADODB.Recordset")
oRecordset.Open "SELECT Sum([FilStr]) FROM [files]", oConnection, 1, 1
intTotalSize = FormatSize(oRecordset.Fields(0).Value)
oRecordset.Close
Set oRecordset = Nothing
%>
This site will give me a sum of all the numbers in FilStr !!
My Sizecount2.asp site:
<!-- #include file="db.asp" -->
<!-- #INCLUDE FILE="sizecount.asp" -->
<html>
<head>
<body>
<%
Response.Write "<b><font face=Tahoma size=2>" & FormatSize(intTotalSize) & "</font></b><font face=Tahoma size=2> Total Filesize</font><br>"
%>
</body>
</head>
</html>
This site shut show me a file size number !!
but i get an error can someone help me to make this script working !??