aegis
Tue 28 November 2006, 07:44 am GMT +0200
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.
Code:
<?php
ini_set("post_max_size", "128M");
ini_set("upload_max_filesize", "128M");
?>
<?php
include ("upload_class.php"); //classes is the map where the class file is stored (one above the root)
$max_size = 1024*500000; // the max. size for uploading
$my_upload = new file_upload;
$my_upload2 = new file_upload;
$my_upload->upload_dir = $_SERVER['DOCUMENT_ROOT']."/metal/";
$my_upload2->upload_dir = $_SERVER['DOCUMENT_ROOT']."/band_images/";
$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); }
ini_set("post_max_size", "128M");
ini_set("upload_max_filesize", "128M");
?>
<?php
include ("upload_class.php"); //classes is the map where the class file is stored (one above the root)
$max_size = 1024*500000; // the max. size for uploading
$my_upload = new file_upload;
$my_upload2 = new file_upload;
$my_upload->upload_dir = $_SERVER['DOCUMENT_ROOT']."/metal/";
$my_upload2->upload_dir = $_SERVER['DOCUMENT_ROOT']."/band_images/";
$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); }