note 50939 added to features.file-upload
| From: | thisisroot at gmail dot com | Date: | Mon, 14 Mar 2005 15:33:03 +0000 |
| Subject: | note 50939 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86417@lists.php.net to get a copy of this message | ||
If you're having problems uploading large files but small files go through fine, here are some
things to try:
- In the HTML form, make sure you've set MAX_FILE_SIZE to an acceptable value.
- In php.ini, be sure you've set the the upload_max_filesize and post_max_size to be large
enough to handle your upload.
- In your httpd.conf (if you're using apache), check that the LimitRequestBody directive
isn't set too low (it's optional, so it may not be there at all).
If those settings don't work, you can check your firewall configuration. When uploading large
files, packets have to be split into fragments of varying size depending on your systems MTU
(maximum transmission unit), which is typically 1500 bytes.
Because some systems send the packets with the headers last (or the header packet may be received
after some of the data packets), firewalls can't filter this traffic based on destination port
and address. Many firewalls (including iptables) have to be configured to allow fragments separately
from standard traffic. Unfortunately, it's an all-or-nothing thing in these cases, and exploits
based on packet fragmentation have been a problem in the past (teardrop, boink, etc.). Note that
ICMP may be used to notify the host (your server) of oncoming fragmentation, so you may need to
allow ICMP traffic as well.
The iptables rules for this are as follows:
# allow all fragments
-A INPUT -f -j ACCEPT
# allow icmp traffic
-A INPUT -p icmp -j ACCEPT
On the bright side, this will also fix some issues with ssh and NFS =)
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50939
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50939&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50939&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50939&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50939&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50939&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50939&report=yes
Search -- http://master.php.net/manage/user-notes.php