in reply to copying a file

why do you want to copy a local file by using ftp?
And I assume you noticed that your are missing a '/' in
$ftp->get("$file","/doytest/cgi-bin/Data/Temp$fileB"); should be: $ftp->get("$file","/doytest/cgi-bin/Data/Temp/$fileB");
.:| If it can't be fixed .. Don't break it |:.