# PHP: MP3 Upload Form

**URL:** <https://forum.kirupa.com/t/php-mp3-upload-form/33813>\
**Category:** programming\
**Created:** [October 23, 2003, 8:51pm UTC](https://forum.kirupa.com/t/php-mp3-upload-form/33813 "2003-10-23T20:51:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rysolag](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@rysolag](https://forum.kirupa.com/u/rysolag)\
**Post date:** [October 23, 2003, 8:51pm UTC](https://forum.kirupa.com/t/php-mp3-upload-form/33813/1 "2003-10-23T20:51:20Z")

</div>

Alright…

```
I am trying to write a PHP page that will enable the user to upload an MP3 to a server. Here's my page:

```

## uploadMedia.php

\<html\>

\<head\>  
\<title\>\</title\>  
\</head\>

\<body\>

\<?  
if(!empty($\_FILES[“userfile”]))  
{  
echo “Something Came Through\<BR\>\<BR\>”;  
echo $\_FILES[“userfile”][“name”] . “\<BR\>\<BR\>”;

if($\_FILES[“userfile”][“tmp\_name”] == “”)  
echo “empty”;  
else  
echo $\_FILES[“userfile”][“tmp\_name”];  
}  
?\>

\<form method=“post” enctype=“multipart/form-data” action=“uploadMedia.php”\>  
\<input type=“file” name=“userfile”\>  
\<input type=“submit” value=“submit”\>  
\</form\>

\</body\>

\</html\>

* * *

## end

```
When submitted the $_FILES["userfile"] always has something but $_FILES["userfile"]["tmp_name"] is always empty and $_FILES["userfile"]["name"] always has the correct original file name . This means that the server is never storing the file.

I am testing this on my own computer at home running XP and IIS. Can anyone help?

```

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 24, 2003, 1:29pm UTC](https://forum.kirupa.com/t/php-mp3-upload-form/33813/2 "2003-10-24T13:29:47Z")

</div>

what is the size of the mp3 file ??

If bigger than 2mb I think you got problem …

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 24, 2003, 10:06pm UTC](https://forum.kirupa.com/t/php-mp3-upload-form/33813/3 "2003-10-24T22:06:10Z")

</div>

I am building a site and users should be able to upload mp3 files to the server regardless of the size.

How can I do this?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 25, 2003, 9:03pm UTC](https://forum.kirupa.com/t/php-mp3-upload-form/33813/4 "2003-10-25T21:03:53Z")

</div>

You need to change it in the php.ini file I think. Towards the bottom there’s the section on file uploads. Actually in the middle of the ini file :nerd:

You need to change this:  
; Maximum allowed size for uploaded files.  
upload\_max\_filesize = 2M

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 26, 2003, 6:48am UTC](https://forum.kirupa.com/t/php-mp3-upload-form/33813/5 "2003-10-26T06:48:10Z")

</div>

…still doesnt work.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 28, 2003, 2:15am UTC](https://forum.kirupa.com/t/php-mp3-upload-form/33813/6 "2003-10-28T02:15:43Z")

</div>

top…
