无法将txt文件放入带有fput的服务器

I can connect to a server using an FTP client and move files up and down with no issue. When I try with ftp_put it fails to upload the files. I am opening a directory on server 1 and reading the files and removing anything with any . listing, as the files are read i am displaying the files on screen to see that they are listed and then trying to upload them using ftp_put to server 2 but they are failing to upload. Can anyone see why this does not work please. The permissions on the folder on server 2 are set correctly and i am connected and have tried using pasv mode.

$conn_id = ftp_connect($ftp_server,$port);
$login_result = ftp_login( $conn_id, $ftp_user_name, $ftp_user_pass );

if (!$conn_id) {
echo 'Failed to connect';
} else {
if (!$login_result) {
echo 'Failed to log in';
} else {
ftp_pasv($conn_id, true);    
$path='this/path';
$dir_handle = opendir($path) or die("Error opening $path");

while ($file = readdir($dir_handle)) {
if (substr($file,0,1)=='.') {
} else {
$upload = ftp_put($conn_id, 'Testdir/FilesInThisDir/'.$file, $file, FTP_ASCII);
print (!$upload) ? 'Cannot upload '.$file : 'Upload complete';
print "<br>";
}
}
}
}
ftp_close($conn_id);

The answer turned out to be simple really. The guy did not give me the absolute path to work with :)