Re: How to assure that php.ini is being obeyed?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sebastian Mendel,
I am using simple scripts to verify this file size issue:
The Html file that accepts the job is as follows:
<form enctype="multipart/form-data" action="uploading.php" method="POST">
   <input type="hidden" name="MAX_FILE_SIZE" value="8000000" />
   <p>Send this file: <input name="userfile" type="file" />
   <p><input type="submit" value="Send File" />
</form>

The action php script is as follows:
<?php
  # uploading.php - Process the saving of an uploaded file
  $name = $_FILES[userfile][name];
  $type = $_FILES[userfile][type];
  $size = $_FILES[userfile][size];
  print( "The file is called $name, type $type, size $size<br>" );
  print( "Error message: $php_errormsg<br>" );
?>

I don't know how to see the error message, because when I submit a large file for uploading, it does not even
execute the php script; the message "This document contains no data" pops up; if I click on "OK", the php script
is not executed. I think I need a function that will catch the error before the system message pops up, but I don't
know how to code it.
So, that is why I am baffled. The error message that I see is not explanatory of the real situation.
Mario Miyojim


Sebastian Mendel wrote:

Llc Mailit wrote:

My problem: To upload large files.
Although /etc/php.ini on my Linux server specifies
upload_max_filesize = 8M
post_max_size = 8M
only files smaller than 512 kB are uploaded, while larger files fail with message
"This document contains no data"


quota?
free space?
try setting display_errors and startup_errors on
try track_errors with on


also, when using apache 1.3.2 or later, see the LimitRequestBody directive.


I set display_errors, startup_errors, track_errors On in php.ini, restarted Apache and reran an upload session.
The only error message displayed upon attempt to upload a large file is "This document contains no data"
The specified log file is empty.


did you check $php_errormsg ?

"track_errors boolean
If enabled, the last error message will always be present in the variable $php_errormsg."




-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux