But it is not recommended for smaller projects like yours because the comparison work done to the actual process and ram load is greater than just storing it regularly. Not until you have very large files does it become somewhat useful.
Two ways of dealing with that are to store the files on the filesystem, and then only store the files paths in the db, or to store the binary data of the image in a blob field.
If the pictures are big, you might also want to go one step further and store a single file across multiple db records. I've never done it myself, but I've heard that people sometimes have problems (in MySQL) loading or storing more than 1MB into a single field, so they cut the file up and store it in slices.
The second option is obviously more complex, so I'd go for the first if possible.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.
Busy posted this at 08:38 — 28th February 2005.
He has: 6,151 posts
Joined: May 2001
You dont want to save the actual image in the database, just save the images name (and details like width, height etc if you want).
naoshad posted this at 16:46 — 2nd March 2005.
He has: 23 posts
Joined: Feb 2005
Thanks Busy. For your information
hank85 posted this at 03:59 — 12th March 2005.
They have: 3 posts
Joined: Mar 2005
What you want to do is take a look into BLOB. Binary Large Object that can hold a variable amount of data.
MySQL: BLOB:
http://dev.mysql.com/doc/mysql/en/blob.html
But it is not recommended for smaller projects like yours because the comparison work done to the actual process and ram load is greater than just storing it regularly. Not until you have very large files does it become somewhat useful.
naoshad posted this at 07:07 — 14th March 2005.
He has: 23 posts
Joined: Feb 2005
Thnaks
thisnew posted this at 11:52 — 17th March 2005.
They have: 8 posts
Joined: Feb 2005
Two ways of dealing with that are to store the files on the filesystem, and then only store the files paths in the db, or to store the binary data of the image in a blob field.
If the pictures are big, you might also want to go one step further and store a single file across multiple db records. I've never done it myself, but I've heard that people sometimes have problems (in MySQL) loading or storing more than 1MB into a single field, so they cut the file up and store it in slices.
The second option is obviously more complex, so I'd go for the first if possible.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.