Audio File uploads to database tables - what "type" do I define it as?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cowgurl art
    New Member
    • Jun 2007
    • 2

    Audio File uploads to database tables - what "type" do I define it as?

    Hey there. I will not pretend to know more than I do...I'm just getting my feet wet with Dreamweaver and MySql databases. What I'm trying to do is create a form that will allow members to submit an audio file (mp3 or .wav) from a website. The form will insert the record into the database IF I can get it configured correctly. Here's the problem- I don't know what type to list the field as in order to get it to accept a file upload. Is this even possible?

    I have the tables set up in the database and I have the insert record form page written in php (thanks to Dreamweaver). Can anyone offer any advice on how I can allow submission of audio files?

    If I'm not being specific enough, please let me know and I'll try to better explain.

    Thanks!
    Cowgurl Art
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, cowgurl art. Welcome to TSDN!

    You have two options:

    Comment

    • cowgurl art
      New Member
      • Jun 2007
      • 2

      #3
      Originally posted by pbmods
      Heya, cowgurl art. Welcome to TSDN!

      You have two options:
      Thank you for this reply. I did give up and decided to upload the file via ftp to the server and just input the url to the file in the insert record form on the website. So, I took the easy way out.

      I thought it should be a BLOB but I didn't know how to make the "insert record form" accept the blob. I'll think on this now that you've given me some help and maybe I can work it out. Thanks!

      Comment

      • cat1205123
        New Member
        • Jun 2007
        • 1

        #4
        I'm doing a similar project myself.

        Between the two (upload or store in a DB), why would I want to choose one over the other?
        e.g. Does one take up more physical space? Does one have less overhead?

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          Originally posted by cat1205123
          I'm doing a similar project myself.

          Between the two (upload or store in a DB), why would I want to choose one over the other?
          e.g. Does one take up more physical space? Does one have less overhead?
          It would depend on what you want to do with your files.

          It is probbly simpler to save files onto the file system. That way also makes retreiving them much simpler.
          On the other hand, if your files contain sensetive data, they would be much more secure inside the DB, and you would have much more control over how they are handled.

          You will have to jump through some hoops to insert and retreive them from the database, which many people will say can cause some extra overhead, but I think that's more of a myth than a fact. Most extra overhead is caused by poorly designed code.

          Anyways, If you want people to have easy access to the files, I would upload them the old fashion way. If you want them keep them away from people, I would put them on the Database.

          But thats just me.

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #6
            Originally posted by Atli
            Anyways, If you want people to have easy access to the files, I would upload them the old fashion way. If you want them keep them away from people, I would put them on the Database.
            Even then, all you'd have to do is store the files outside your webserver's document root and use include or fread to access them.

            The major difference in my opinion is that a CMS that stores files in the database is a pain in the butt to maintain, especially when somebody else wrote it (can you tell what I'm working on right now? :P).

            Comment

            Working...