1 Introduction
The advent of the internet era, making a variety of internet-based applications, most of the application system will use the image data, need to display the picture in the user interface. Here is an implementation method that stores pictures in a folder. then display as required. The implementation step is to store the additional information of the picture path and other records in the database, while the real picture file is stored in a folder. This method is a good solution.
2 processing mode of the picture
There are two ways to handle a picture: The ① image data is stored directly in the hard disk in a file format, and the record in the database is saved with additional information (path, filename, comment ...) ; ② pictures are stored directly in the database. There are pros and cons to each of these two ways. Picture files stored in the database for ease of management and maintenance, and the hard drive may be deleted because of accidentally delete picture files, and make the data inconsistent: But the picture in the database is not easy to modify editing, but also cause the database reading data when I/O consumption, but on the hard disk will not cause this problem So for small files, recommended in the database for easy management, and for large files, and can not be placed in the database, otherwise the database table will produce a large number of fragments of data files.
3 Image Storage Methods
The system uses ASP. NET and SQL Server database to implement the storage of pictures. Store the picture in the directory specified by the hard disk, storing the relative storage path of the picture and other ancillary information in the database. The language used in the development platform is VB, and the database access technology is AD0. NET impressive according to the access mechanism is AD0. NET in the OLE DB mechanism.
3. 1 Establishment of database tables
For picture storage in the entire picture management system, a Picture content table (MYIMG) needs to be established, as shown in table 1.