Page 1 of 1
Ftp_put not uploading file size bigger than 1M
Posted: Wed Jan 14, 2004 1:06 pm
by ssaboo
Am using following code to upload a file to ftp server.
----------------------------
$login = @ftp_login($conn, $ftpUser, $ftpPass) or die ("Login details failed !");
$putFile = @ftp_put($conn, $_FILES[file1][name],$_FILES[file1][tmp_name], FTP_BINARY);
----------------------------
Ftp works fine for smaller file size but errors out on file size bigger than 800K. I get this error:
The POST method does not allow the data transmitted, or the data volume exceeds the capacity limit
I checked php.ini and these settings seems ok .
post_max_size = 8M
upload_max_filesize = 50M
Can somebody tell me what is wrong? Thanks in advance for your time.
Posted: Thu Jan 15, 2004 3:04 am
by twigletmac
What does the HTML for the upload form look like - are you limiting file size in that? Does the error message give any information as to where it is coming from, e.g. browser or webserver.
Mac
P.S. Definitely have a read of the second link in my signature - "Why is $foo[bar] wrong".
Posted: Thu Jan 15, 2004 1:01 pm
by ssaboo
Thanks for your reply.
The html code is like this...(no file size specified)
----------------------------------------
<BODY>
<form method="post" action="do_uploadFTP.php"; enctype="multipart/form-data">
<p><strong>File to Upload:</strong><br>
<input type="file" name="file1" size=40></p>
<p><input type="submit" name="submit" value="Upload File"></p>
#echo phpinfo() ;
</BODY>
----------------------------------------
Apperently, it is a server error. I see this in Apache error log:
------------------------------
[Thu Jan 15 13:54:34 2004] [error] [client 66.207.130.10] Requested content-length of 1270730 is larger than the configured limit of 524288.
------------------------
What settings should be changed and where? We are using Plesk (which uses Apache) for managing web sites.
Thanks a lot.
Posted: Fri Jan 16, 2004 5:54 am
by twigletmac
Definitely sounds like Apache has been configured to not accept file uploads bigger than 512kB. Depending how much control you have over your Apache installation (you may find it easier to speak directly with your host) this is the directive you'd probably need to adjust:
http://httpd.apache.org/docs/mod/core.h ... equestbody
Mac
Posted: Fri Jan 16, 2004 1:03 pm
by ssaboo
Thanks for pointing me out to right direction.
First, I could not find LimitRequestBody directive in httpd.conf file. Upon doing further searching, I found this directive in php.conf.
I changed the LimitRequestBody and now I can upload files of larger size.
Thanks a lot "twigletmac". Greatly appreciate your timely help.
- Happy user of this forum
