Upload from server

I want to upload from my server “target.txt” that is “source.,txt” on the server. I can not get the $source right for my webserver. Any suggestions?

$source = "/home/source.txt";
$target = fopen("target.txt", "w");

$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");



Usually the /home/ path is always followed your servers username which is started on unix servers, eg. /home/xxx123/source.txt

I have tried many ways to get the right $source to work. I have tried:

$source = “/home/path/source.txt”;
$source = “ftpname@webserver.com/home/path/source.txt”;
$source = “http://www.webserver.com/home/path/source.txt”;
$source = “ftp.webserver.com/home/path/source.txt”;
$source = “c:/home/path/source.txt”; //obviously does not work

Does anyone know how to input a valid $source?

Have you tried your FTP settings in an FTP client to check the paths as that would be the best way to go about it.