Ok, thanks, that did the trick. There is one more thing I am trying to do. I would like to write a script that would batch upload a group of images I have located in a folder with the name of the image stored in a database. So here is what i was thinking... I would just pull the names from the data base and upload them using the ftp_fputs.
$query = ....
$result = ....
while($row=mysql_fetch_array($result))
{
$fp = fopen($file, 'r');
$conn_id = ftp_connect($ftp);
$login_result = ftp_login($conn_id, $user, $pass);
if (ftp_chdir($conn_id, "newFolder")) {
} else {
echo "Couldn't change directory\n";
}
if (ftp_fput($conn_id, $file, $fp, FTP_BINARY))
{
echo "successfull";
}
ftp_close($conn_id);
fclose($fp);
}...
The only thing I see being a problem is the length of time it would take, since it actually has to open the file. These are images so the length would be increased quite a bit.
I am also using binary, since its a image, is this correct?
I hope what i am saying makes sense. Is there a better way to do this through php?