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ść

  1. <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  2.  
  3. <fieldset><legend>Fill out the form to upload a file:</legend>
  4. <input type="hidden" name="MAX_FILE_SIZE" value="15000000" />
  5. <p><b>File:</b> <input type="file" name="upload" /></p>
  6.  
  7. <p><b>Description:</b> <textarea name="description" cols="40" rows="5"></textarea></p>
  8.  
  9. </fieldset>
  10.  
  11. <div align="center"><input type="submit" name="submit" value="Submit" /></div>
  12.  
  13. </form>
  14. <?php
  15. $page_title = 'Upload a File';
  16.  
  17.  
  18. if (isset($_POST['submit'])) { // Handle the form.
  19.  
  20. require_once ('config.php'); // Connect to the database.
  21.  
  22. // Function for escaping and trimming form data.
  23. function escape_data ($data) {
  24. global $dbc;
  25. if (ini_get('magic_quotes_gpc')) {
  26. $data = stripslashes($data);
  27. }
  28. return mysql_real_escape_string (trim ($data), $dbc);
  29. } // End of escape_data() function.
  30.  
  31. // Check for a description (not required).
  32. if (!empty($_POST['description'])) {
  33. $d = escape_data($_POST['description']);
  34. } else {
  35. $d = '';
  36. }
  37.  
  38. // Add the record to the database.
  39. $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())";
  40. $result = @mysql_query ($query);
  41.  
  42. if ($result) {
  43.  
  44. // Create the file name.
  45. $extension = explode ('.', $_FILES['upload']['name']);
  46. $uid = mysql_insert_id(); // Upload ID
  47. $filename = $_FILES['upload']['name'];
  48.  
  49. // Move the file over.
  50. if (move_uploaded_file($_FILES['upload']['tmp_name'], "./uploads/$filename")) {
  51. echo '<p>The file has been uploaded!</p>';
  52. } else {
  53. echo '<p><font color="red">The file could not be moved.</font></p>';
  54.  
  55.  
  56. $query = "DELETE FROM uploads WHERE upload_id = $uid";
  57. $result = @mysql_query ($query);
  58. }
  59.  
  60. } else {
  61. echo '<p><font color="red">Your submission could not be processed due to a system error. We apologize fo
    r any inconvenience.</font></p>'
    ;
  62. }
  63.  
  64.  
  65. }
  66. ?>