Storing Files

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
kinger88
Forum Newbie
Posts: 12
Joined: Thu Apr 09, 2009 10:08 am

Storing Files

Post by kinger88 »

Hi,

Just joined this forum, looks like it will be very helpful!

I'm a student and i have to do a project which i am doing in PHP.

I want to allow users to upload pictures and mp3 files and was just wondering what the best way to store these files is?

My guesses are either store the file directly in a database
Or store the files in a folder and store the location and or filename in the database?

Plus i don't think it's possible in PHP, but someone may have an idea of how to make a simple player for the mp3 files?

Cheers
Steve
Bruno De Barros
Forum Commoner
Posts: 82
Joined: Mon May 12, 2008 8:41 am
Location: Ireland

Re: Storing Files

Post by Bruno De Barros »

Your guess is correct, you should do it that way :)

No, PHP cannot play MP3 files. PHP is not meant for that sort of thing. Use a Flash MP3 Player or something.
User avatar
allspiritseve
DevNet Resident
Posts: 1174
Joined: Thu Mar 06, 2008 8:23 am
Location: Ann Arbor, MI (USA)

Re: Storing Files

Post by allspiritseve »

kinger88 wrote:Or store the files in a folder and store the location and or filename in the database?
This way would be best.
kinger88
Forum Newbie
Posts: 12
Joined: Thu Apr 09, 2009 10:08 am

Re: Storing Files

Post by kinger88 »

Ok thanks for the help 8)
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: Storing Files

Post by kaisellgren »

Is it possible for any arbitrary guests to upload MP3s? If so, you really need to keep your eyes open for security holes and in fact, you probably should show us your code.
Post Reply