The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I just finished doing 2 smaller projects in php/mysql and was thinking about starting a bigger one. One of the sites that i maintain has a top 20 list of songs and another list of songs all in the real audio format. Each song has its corresponding fields title, artist etc....

I would like to create a system that the client would be able to use that would enable them to upload files to a mysql database(not sure how to do this) and then the *.ram file would need to be generated (is this possible using php). I need to create *.ram files because I do not have access to a real media server for streaming

There is some other things that I was considering as well such as keeping track of which songs have been listened to most and a vote feature etc... but I dont think those will be to difficult to do once I get the infrastructure down.

Any help on the issues of uploading to a database and creating *.ram files using php will be appreciated.

As far as I know a .ram file just contains the address of the .rm file.

As for storing the files in a database, that is not very difficult to do all you need to do is open the file (fopen) and read it in then store it in a binary field in your database. The way of getting it out again is to output the contents of the file to the browser (print) after you have sent the content type header ( header("Content-type: xxxx\n\n") ) which would be the correct mime type for the .rm file.

------------------
Karl AustinKDA Web Services
"Everyone has a photographic memory. Some just don't have film."

Yup -- the only stumbling block will be converting whatever format your users upload into the Real Media format. Unfortunately, PHP has no in-built support for this. If you can find an external program that does this from the command line, you could run the program from within PHP using exec().

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>Originally posted by cmystikal:I would like to create a system that the client would be able to use that would enable them to upload files to a mysql database<HR></BLOCKQUOTE>

hehe, kevin, he wouldnt need to worry about file permissions if he's dumping the binary data into mySQL .. as far as i know and have done in the past

those php fuctions will come in usefull once I get by my first stumbling block.

How would i create a 'browse' button which would allow the user to choose files from their hardrive to upload... how would I go about doing that and how could i direct the files to be sent to the desired directory