Forum Moderators: mack

Message Too Old, No Replies

Storing files, etc in mysql database

Inserting objects into mysql database

         

silk

9:05 am on Oct 10, 2004 (gmt 0)

10+ Year Member



Here's my little dilemna. I have NEVER inserted anything into a mysql database. I have a site, where i need to keep track of certain downloads. Now i figured that i could store a link to the download, in the database. Then i wondered, can i put the actual download in the database. Is this possible, and if it is, what are the limits / restrictions on such?

Somehow i get the feeling, storing the link is a preferred solution, but i think i want to put the downloads into the database. If it does matter, the downloads are PDF files, and some saved games (zipped).

Thx!

mincklerstraat

9:28 am on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd guess that there would be few circumstances indeed where there would be a benefit to putting those files in the database instead of in the filesystem. You should probably specify why exactly it is you want these in the db instead of the filesystem if you want good advice on this matter. If it's a matter of not having links which are downloadable without some form of authentication, this recent thread: [webmasterworld.com...] covers this. You can also use the PEAR class 'HTTP Download'.

I've never tried this myself, and I don't rememeber the maximum field sizes off the top of my head (you can look these up at mysql.com), but I do remember reading on the mysql site that the mysql people themselves advise keeping images in the filesystem, and not in the database. When it comes to PDF's and zip files, which in general will be much larger, it would seem to make even more sense to keep these in the filesystem.

silk

9:41 am on Oct 10, 2004 (gmt 0)

10+ Year Member



Lol...u hit the nail on the head!

Yeah i was thinking about providing authentication for the downloads, because i want them to be available to registered members.

But i'll cancle that idea, for 2 reasons. I suspected the filesystem would be better...lol and i believe that restricting the downloads to registered members only might involve a little more than i know right about now. Maybe some sort of session management or something...

Ah well....filesystem, links, and downloads for all.
:) :)

Thx thought! Bless!

silk

9:48 am on Oct 10, 2004 (gmt 0)

10+ Year Member



i had a look at the link....lol lol..

Honestly, i'm very lost there. But no problem. I'll get there some day.

I'll work with a simple database for now ;) , simple php.

Thx though!