My name is Bong, James Bong
Posts: 11
74 credits Members referred : 0
« on: Nov 28, 2006, 07:44:40 AM »
Ok for some reason this wont upload an mp3 to my server past a certain file size. If i put an mp3 6mb or lower it works fine but above that it wont work and it gives me no error message. I had this same problem before because my server's something.ini file didnt allow a remote upload of that size and it gave me an error message saying it was too big. But I got that .ini file fixed so it should work. Now it just doesnt give me an error message or anything. It just doesnt upload. here's my code if you wanna take a look.
$my_upload->extensions = array(".mp3"); // specify the allowed extensions here $my_upload2->extensions = array(".jpg"); // specify the allowed extensions here
// $my_upload->extensions = "de"; // use this to switch the messages into an other language (translate first!!!) $my_upload->max_length_filename = 100; // change this value to fit your field length in your database (standard 100) $my_upload->rename_file = true;
$my_upload2->max_length_filename = 100; // change this value to fit your field length in your database (standard 100) $my_upload2->rename_file = true; if(isset($_POST['Submit'])) { $my_upload->the_temp_file = $_FILES['upload']['tmp_name']; $my_upload->the_file = $_FILES['upload']['name']; $my_upload->http_error = $_FILES['upload']['error']; $my_upload->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "y"; // because only a checked checkboxes is true $my_upload->do_filename_check = (isset($_POST['check'])) ? $_POST['check'] : "n"; // use this boolean to check for a valid filename $new_name = (isset($_POST['name'])) ? $_POST['name'] : ""; if ($my_upload->upload($new_name)) { // new name is an additional filename information, use this to rename the uploaded file $full_path = $my_upload->upload_dir.$my_upload->file_copy; $info = $my_upload->get_uploaded_file_info($full_path); } // ... or do something like insert the filename to the database $my_upload2->the_temp_file = $_FILES['upload2']['tmp_name']; $my_upload2->the_file = $_FILES['upload2']['name']; $my_upload2->http_error = $_FILES['upload2']['error']; $my_upload2->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "y"; // because only a checked checkboxes is true $my_upload2->do_filename_check = (isset($_POST['check'])) ? $_POST['check'] : "n"; // use this boolean to check for a valid filename $new_name2 = (isset($_POST['name'])) ? $_POST['name'] : ""; if ($my_upload2->upload($new_name2)) { // new name is an additional filename information, use this to rename the uploaded file $full_path = $my_upload2->upload_dir.$my_upload2->file_copy; $info = $my_upload2->get_uploaded_file_info($full_path); }
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6486
39748 credits Members referred : 374
My name is Bong, James Bong
Posts: 11
74 credits Members referred : 0
« Reply #6 on: Nov 28, 2006, 04:37:11 PM »
ok well what do you mean? I'll have to talk to my web hosting to change the file so what should i tell them? I can upload files bigger than 2M right now though. it goes to about 6M.
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6486
39748 credits Members referred : 374
ok well what do you mean? I'll have to talk to my web hosting to change the file so what should i tell them? I can upload files bigger than 2M right now though. it goes to about 6M.
My name is Bong, James Bong
Posts: 11
74 credits Members referred : 0
« Reply #8 on: Nov 29, 2006, 03:55:38 AM »
oh actually i just noticed the error log file. it says this. [27-Nov-2006 23:21:01] PHP Warning: POST Content-Length of 9537535 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
so how do i get it bigger than that? they said they set my php.ini max upload to 32M a while ago..
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6486
39748 credits Members referred : 374
It's time to use PHP5!
« Reply #9 on: Nov 29, 2006, 09:32:45 AM »
the post_max-size need to be set inside the php.ini or .htaccess
I think that this directive is set lower then your upload_max_filesize (what actually makes no sense)