Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorjustjack
    • CommentTimeOct 30th 2006 edited
     permalink
    How do I take a file uploaded to my server and get it into my database?
    • CommentAuthorMatt
    • CommentTimeOct 30th 2006
     permalink
    I honestly would never recommend storing the file is in the database, what I usually do is have them all uploaded to the same place, and then store the filename in the database.
    • CommentAuthordhayes
    • CommentTimeOct 31st 2006
     permalink
    as far as I know, the only difference is overhead. it takes more time and resources to pull data from a database than file system.

    http://www.php-mysql-tutorial.com/php-mysql-upload.php
    • CommentAuthorMatt
    • CommentTimeOct 31st 2006
     permalink
    Yes, and imagine if 5,000 people were viewing the image at the same time... that is 5,000 connections to the database... which is ridiculous.
    • CommentAuthordhayes
    • CommentTimeOct 31st 2006 edited
     permalink
    either way.. 5,000 to the database or to the disk, 5,000 is 5,000. the number doesn't increase just because you go to the database. Like I said, the difference is overhead. Assuming you're already grabbing page data from the same query, your loss is minimalized.
    • CommentAuthordhayes
    • CommentTimeOct 31st 2006
     permalink
    i'm not condoning the method by the way.. i agree that it's not good general practise, but it can often be useful for storing sensitive data and files off of the file system.
    • CommentAuthorMatt
    • CommentTimeOct 31st 2006
     permalink
    Agreed, sensitive data, but I am assuming this is just to relate the image with certain information in the database.. Either time you are accessing the disk, but you are accessing the database... and only so many sql connections can be made at one time. The mysql thing is decent though for say easily getting the impressions of a certain image, but I am assuming he is going for something different.
    • CommentAuthorqweqwe30
    • CommentTimeOct 31st 2006
     permalink
    And how MySQL stores databases if not on disk?
    Matt, you mention limit of connections - filesystems often have limits of opened files too.
    • CommentAuthorMatt
    • CommentTimeNov 1st 2006
     permalink
    Line should have read "Either time you are accessing the disk, but you are accessing the database as well."

    As far a file systems limits to opened files, it is there, but mysql's default is 100 for the table... Instead of putting people in line sort of speak like hard drive access it would give you a too many connection error... I guess you could program your own sort of waiting to access the database thing, but that is pointless work when you can just link to the actual file on the hard drive.
    • CommentAuthorJack
    • CommentTimeNov 1st 2006
     permalink
    In every case I've seen the file is stored on the disk, and you simply pull the path to the file from the database. You'd need some kind of system to avoid uploading files with the same name though.
    • CommentAuthorjustjack
    • CommentTimeNov 3rd 2006
     permalink
    Thanks.
Add your comments
    Username Password
  • Format comments as (Help)