Witam mam problem z uploadem plików większych niż 7 MB może ktoś z Was wie gdzie jest problem
ustawienia php.ini
Kod
file_uploads = On
upload_max_filesize = 100M
file_uploads = 1
upload_tmp_dir = "C:\AppServ\www\inc\tmp"
Kod
<input type="hidden" name="MAX_FILE_SIZE" value="15000000" />
w MySQL
FILD--->file_size ---> int(6)---> unsigned --->0
a tu dodaje całość
<form enctype="multipart/form-data" action="
<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<fieldset><legend>Fill out the form to upload a file:</legend>
<input type="hidden" name="MAX_FILE_SIZE" value="15000000" />
<p><b>File:</b> <input type="file" name="upload" /></p>
<p><b>Description:</b> <textarea name="description" cols="40" rows="5"></textarea></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Submit" /></div>
</form>
<?php
$page_title = 'Upload a File';
if (isset($_POST['submit'])) { // Handle the form.
require_once ('config.php'); // Connect to the database.
// Function for escaping and trimming form data.
function escape_data ($data) {
}
} // End of escape_data() function.
// Check for a description (not required).
if (!empty($_POST['description'])) { $d = escape_data($_POST['description']);
} else {
$d = '';
}
// Add the record to the database.
$query = "INSERT INTO uploads (file_name, file_size, file_type, description, upload_date) VALUES ('{$_FILES['upload']['name']}', {$_FILES['upload']['size']}, '{$_FILES['upload']['type']}', '$d', NOW())";
if ($result) {
// Create the file name.
$extension = explode ('.', $_FILES['upload']['name']); $filename = $_FILES['upload']['name'];
// Move the file over.
echo '<p>The file has been uploaded!</p>'; } else {
echo '<p><font color="red">The file could not be moved.</font></p>';
$query = "DELETE FROM uploads WHERE upload_id = $uid";
}
} else {
echo '<p><font color="red">Your submission could not be processed due to a system error. We apologize fo
r any inconvenience.</font></p>'; }
}
?>
Powód edycji: Poprawiłem temat @drPayton