且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

存储图像 - 与MySQL的文件系统

更新时间:2023-11-29 13:42:52

您可以存储在文件系统上的图像,并使用该数据库,以保持一个文件指针,这是简单的路径图像上的位置您的系统。然后,使用一个查询获取的位置,并使用它,你会为任何影像。

You could store the images on the file system, and use the database to keep a file-pointer, which is simply the path to the location of the image on your system. Then, use a query to fetch the location, and use that as you would for any image.

该线程DaniWeb显示上传如何处理:

This thread on DaniWeb shows how uploads could be handled:

http://www.daniweb.com/web-development/php/线程/ 162230

此外,使用相对路径如果要移动的未来图像的位置,正如所选择的答案在这里:

Also, use relative paths in case you wish to move the location of the images in the future, as mentioned in the chosen answer here:

When将图像存储在文件系统中,使用相对路径或绝对路径?