...

View Full Version : ftp_puts



Extreme43
01-02-2006, 10:28 AM
Hey, im writing an update script using ftp but ftp_puts, ftp_fputs ect will return false.

here is the code


$file_from = "http://220.233.71.51/upgrade-test/upgrades/012-0132/files/index.txt";
$mode = "FTP_ASCII";
if ( $file_handle = fopen($file_from, "r") )
{
if ( ftp_fput($ftp, "index.php", $file_handle, $mode) )
{
echo "<font color='green'>Success</font>";
}else{
echo "<font color='red'>Failed</font>";
}
}else{
echo "<font color='red'>Could not open remote file</font>";
}
fclose($file_handle);


It can open the file but cannot upload it

GJay
01-02-2006, 11:08 AM
You seem to be mixing things up, take a look at:
http://uk2.php.net/manual/en/function.ftp-fput.php
does it help?

Extreme43
01-02-2006, 12:43 PM
EDIT: The problem seems to be the $mode
You have to type FTP_ASCII into the code, using a variable will not work.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum