File downloads
Moderator: General Moderators
File downloads
I am trying to create a DB in mysql that is going to store files for download by the the user. somebody told me that I have to isert the files in the db and the then link them dynamically. Is there anybody who can explain this in a simpler way?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
as we've talked about this before, here's the short of it: we've pretty much agreed, storing files in the database is not the greatest idea. Instead store them in the filesystem in a folder that's protected by a htaccess or better yet, isn't accessible to a web user (outside the document root) ...
Store only the linking information (filename, full path to actual file for the script to read the file) in the database.
Store only the linking information (filename, full path to actual file for the script to read the file) in the database.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I'm not sure what you want an example of...
the thread is around here somewhere, although I haven't been able to find it in a while.. (might have gotten lost in the database crash)
as for a site that uses these techniques, BattleCorps has (link in my sig), the fiction section is powered like it. Everywhere else, pretty much requires you being a member.. so not too sure you'll get a great sense of how it's done..
the thread is around here somewhere, although I haven't been able to find it in a while.. (might have gotten lost in the database crash)
as for a site that uses these techniques, BattleCorps has (link in my sig), the fiction section is powered like it. Everywhere else, pretty much requires you being a member.. so not too sure you'll get a great sense of how it's done..
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
it mostly stems from having to do extra work to get at the data.. for the server, and the programmer. there are other things like: what's the use of storing static content in the database?
For me, databases haven't seemed really engineered to handle binary data (en masse) like this.. I'm fairly sure the bigger ones, Oracle and Sybase and whatnot have better controls for this.. but the ones most of us use, don't have the feeling like they were designed to handle binary data very easily..
For me, databases haven't seemed really engineered to handle binary data (en masse) like this.. I'm fairly sure the bigger ones, Oracle and Sybase and whatnot have better controls for this.. but the ones most of us use, don't have the feeling like they were designed to handle binary data very easily..