If PHP is used to obtain the website capacity, it is used to upload files to the client. For example, if the website capacity is 20 GB, if the size of a client's upload cannot exceed 1 GB, it can be provided to 20 customers. I was asked this question by my boss. I have no idea why I want to use php .. What do you think of heroes ?, PHPcode & lt ;? Can PHP be used to obtain the website capacity?
Recently, a small website is used to upload files to customers.
For example, if the website capacity is 20 GB, if the size of a client's upload cannot exceed 1 GB, it can be provided to 20 customers.
I was asked this question by my boss. I have no idea why I want to use php .. What do you think of heroes?
------ Solution --------------------
PHP code
$ IFileSizes & $ iFileSizes >=1024) $ iFileSizes = $ iFileSizes/1024. 'KB'; elseif (1073741824> $ iFileSizes & $ iFileSizes >=1048576) $ iFileSizes = $ iFileSizes/1024. 'mb'; else $ iFileSizes = $ iFileSizes. 'byte'; echo $ iFileSizes;?>
------ Solution --------------------
There are multiple solutions:
Different websites may allocate space for each customer.
For the same website: you can collect statistics on the client's uploaded data into the database (or query statistics. you can check the quota of the uploaded data each time. if yes, you can upload the data.
Otherwise pass.
In addition, php can obtain disk space information.
------ Solution --------------------
PHP code
Disk_free_space ("C:"); disk_free_space ("D:"); disk_total_space ("C:"); disk_total_space ("D :");
------ Solution --------------------
Statistics are available. since he built the website, does addition and subtraction work on each upload, modification, and deletion?
------ Solution --------------------
Yes. count the root directory folder of each site.
------ Solution --------------------
You can store as much data as you allocate.
Can a 10g movie be placed in a disk with a capacity of GB?
Original size you allocated-used (that is, the size of the existing data volume) =?
The maximum size of files that can be stored on this website depends on the maximum size you allocate to the directory where the files are stored.
Is your problem too profound, or is it my understanding?
------ Solution --------------------
You can use the disk quota of the operating system.