File upload problem file to large

apps

#1

Hi, i have added a file upload section to a admin only part of a website.

I have also updated the php.ini file for multiple domains(http://wiki.dreamhost.com/PHP.ini), yet i still have problems.

I am trying to upload audio(mp3) no larger than 10M.

Has any one had similar trouble.

Thanks

Griffo


#2

You’ll need to check 2 settings in your php.ini:

post_max_size = 11M upload_max_filesize = 10M

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

yes i have checked those values,

and i did change them initially.

I even restarted phpcgi

and recached php-wrapper.fcgi.

But when i attempt to run my upload script it returns an error of 1 for the php FILES array, which means the php file limit is set lower than file.

im using a mp3 file.

At this stage things are pointing to my php script so ill add it in here.

<?php include "dbconn.php"; //include "php.ini"; $title = $_POST['title']; $url = $_POST['url']; $file = $_POST['file']; //insert print data into db $connection = connectDB(); $insert = " INSERT INTO audio ". " VALUES (null, \"$title\", \"$url\", null)"; $result2 = mysql_query($insert,$connection); disconnectDB($connection); if (move_uploaded_file ($_FILES['file'] ['tmp_name'], "audio/{$_FILES['file'] ['name']}") ) { echo 'all good!'; } else { switch ($_FILES['file'] ['error']) { case 1: print '

The file is bigger than this PHP installation allows

'; break; case 2: print '

The file is bigger than this form allows

'; break; case 3: print '

Only part of the file was uploaded

'; break; case 4: print '

No file was uploaded

'; break; } } ?>