jimfrith
asked on
php ftp problem
I am using the following code to ftp images to the server. This code works fine for small files but Fails for files that are 1mb or more.
I need to ftp files of 8 and 9MB Is there a setting to allow larger ftp's?
<?
// set up basic connection
$ftp_server = "ftp.mysite.com";
$conn_id = ftp_connect($ftp_server);
// login with username and password
$ftp_user_name = "name";
$ftp_password = "password";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_password);
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!\n";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name";
}
// upload the file
$destination_file = './new.pdf';
$source_file = $_FILES['imagefile']['tmp_ name'];
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_ASCII);
// check upload status
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
// close the FTP stream
ftp_close($conn_id);
?>
I need to ftp files of 8 and 9MB Is there a setting to allow larger ftp's?
<?
// set up basic connection
$ftp_server = "ftp.mysite.com";
$conn_id = ftp_connect($ftp_server);
// login with username and password
$ftp_user_name = "name";
$ftp_password = "password";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_password);
// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!\n";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name";
}
// upload the file
$destination_file = './new.pdf';
$source_file = $_FILES['imagefile']['tmp_
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_ASCII);
// check upload status
if (!$upload) {
echo "FTP upload has failed!";
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
// close the FTP stream
ftp_close($conn_id);
?>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
php_value upload_max_filesize "25M"
php_value post_max_size "35M"
php_value memory_limit "70M"
php_value max_execution_time "0"
I think there may be another setting that is limiting my filesizw I thought it might be in the php.conf file but There does not appear to be a php.conf file on our server.
Any suggestions?