Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Coders and Helpers,

I am new in PHP and currently working on a project in which I am required to store audio clips from users onto server. I recently learned how to store images onto server. For that I store Image link into MySQL database rather than storing actual image in the database. But I am confused to do the same for any audio clip because images are easy to display on the webpage but audio clips require plug-in players to run them. So, please if anyone can help me with this matter it would be very kind of him/her.

Any link, any article, or any code will be welcomed.

Thanx!

--
Coder in need!
Posted

1 solution

If you're new to PHP, why would you be working on a project where you have a requirement ? Oh, that's right. Outsourcing. Brave new world, etc.

It works the same. You store the path. To show an image, you'd be rendering an img tag, right ? Or just sending a byte stream and showing it on it's own page ? Either way, for it to work you need to set a MIME type. So, you add a column to your DB that tells you the data type of the file, then based on that data type, you write code to show the different file types. Once you have this framework in place, you can use it for video, Office documents ( if you target Windows and IE ), etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900