Jump to content

Database Size?


TJMAudio

Recommended Posts

if you are storing the images in the database then you could simply echo out the sum of the size of all the blob fields and the number of rows of the table containing all the images.

if they are in a folder you could read the contents of the folder and echo out the number of files in there and grab the size of each file - but that will be very slow if you're hosting thousands of images
Link to comment
https://forums.phpfreaks.com/topic/16973-database-size/#findComment-71526
Share on other sites

i dont no if this will work but shold get the size of all files in a directory hope.

[code]
<?php

$filename="xxxxxx";
$filemode="r";

if(!$a=fopen($filename,$filemode){

while(!feof($a){

$file=fgets($a);

}

$file=files[];

foreach($file as $num) {

$size=filesize($num);

echo "the size of all files are: $size";
}
}else{
echo "no file exist";
}
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/16973-database-size/#findComment-71539
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.