question regard uploading music files
| From: | bo | Date: | Fri, 04 Oct 2002 06:26:25 +0000 |
| Subject: | question regard uploading music files | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-22213@lists.php.net to get a copy of this message | ||
Hi,
I have wrote a php script to upload music files.It looks like working,
however, there is no way I can tell unless I can show it.
How do I show it as a http link on the webpage?
part of the upload script I wrote looks like this:
<input type="text" name="short2" size=50>
...
<input name="userfile2" type="file">
....
$file2 = fopen($userfile2, "r");
$fileContents2 = fread($file2, filesize($userfile2));
$fileContents2 = AddSlashes($fileContents2);
.....
if (is_uploaded_file($userfile2))
{
switch ($userfile_type2)
{
case "audio/x-pn-realaudio";
$mimeName2 = "ram";
break;
case "audio/x-pn-realaudio";
$mimeName2 = "rm";
break;
.....
$insertQuery = "INSERT INTO files VALUES (NULL, \"{$Name}\", \"{$short2}\",
\"{$userfile_type2}\", \"{$mimeName2}\",
\"{$fileContents2}\",