codeigniter image uploading mysql

前端 未结 3 1219
忘了有多久
忘了有多久 2021-01-07 01:02

I wanted to know if I was uploading an image in CodeIgniter to a database what would be my

$config[\'upload_path\']

All the examples I have

3条回答
  •  一向
    一向 (楼主)
    2021-01-07 01:14

    You can read this great article called Storing Images in Mysql.

    The article covers the following:

    • Isn’t this a bad idea?
    • What is a BLOB?
    • Creating an image table
    • The upload form
    • Uploading the image
    • The upload() function
    • Display an image from the database
    • Displaying all the information

    But not to leave you empty handed, look into Blob, it's a data-type for colums in MySQL ( and various other dbms ). This will let you store data such as Images and other binary file-types.

    The idea of storing files and images in the database is in general the same as storing them on the filesystem, the layer in-between upload and having the actual file is just different.

    You cannot just set your upload-path and hope everything is solved, you need to get some dirt on your hands aswell!

提交回复
热议问题