In the context of the rapid development of the Internet, the data content on the network grows exponentially, among them, the fastest growing and most likely to challenge the information infrastructure is a large number of small files (tablets, e-books, emails, etc ). The number of files on the virtual hosts purchased by our grassroots webmaster is usually limited. a large number of small files occupy a large amount of resources. in the outdated vertices, Douban is recommended for solutions, but the host permission is required. I can only install another idea and use php + SQLite to solve the problem. after my tests, it is practical and recommended to you now.
Public Code now:
Create a database file: php1.php
The code is as follows:
$ Db = new SQLite3 ('mysqlitedb. db ');
// Obtain the binary stream of a file
$ Filename = "http://www.bitsCN.com/logo.gif ";
$ Handle = fopen ($ filename, "r ");
$ Contents = fread ($ handle, filesize ($ filename ));
Fclose ($ handle );
// Create a data table
$ Db-> exec ('create TABLE person (idnum TEXT, name TEXT, photo BLOB )');
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service