upload_dir = $DOCUMENT_ROOT."/files/"; // "files" is the folder for the uploaded files (you have to create this folder) $my_upload->extensions = array(".png", ".zip"); // 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 = 50; // change this value to fit your field length in your database (standard 100) if(isset($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'] : "n"; // 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 $my_upload->upload(); // use the following if clause to do something if the upload is true /* if ($my_upload->upload()) { do something ... like insert the filename to the database } */ } ?>
Max. filesize = bytes.
show_error_string(); ?>