ftp_put给出错误尝试处理时参数不正确

I have the below syntax where I am trying to move a file in my current local server directory onto an FTP server.

$source = $csv_filename;
$target = fopen("/LocExports/test.csv", "w");

$conn = ftp_connect("ftp.server.co.za") or die("Could not connect");
ftp_login($conn,"username","password");

$upload = ftp_put($conn, $target,$source,FTP_ASCII);
if (!$upload) { echo 'FTP upload failed!'; }

This fails with error The parameter is incorrect

$csv_filename is the name of the file on my local server. it is in the same folder as the php file.

my destination is effectively: http://www.server.co.za/kisv2/xmltest/

any help would be appreciated.

Thanks as always,

UPDATE

As per alex's advice, here is updated syntax:

$csv_filename = 'export-2013-06-13 15:19:48.csv';
$source = $csv_filename;  //this is a file in the same directory as my php file. full path is... http://www.server.co.za/kisv2/xmltest/export-2013-06-13 15:19:48.csv
$target = '/LocExports/'.$csv_filename; //full path is... ftp://ftp.hulamin.co.za/LocExports/

$conn = ftp_connect("ftp.server.co.za") or die("Could not connect");
ftp_login($conn, "username", "password");

$upload = ftp_put($conn, $target, $source, FTP_ASCII);
if (!$upload) { echo 'FTP upload failed!'; }

Get rid of the fopen() like this:

$csv_filename = 'test.csv';
$source = '/local/path/to/'.$csv_filename; 
$target = '/LocExports/'.$csv_filename;

$conn = ftp_connect("ftp.server.co.za") or die("Could not connect");
ftp_login($conn, "username", "password");

$upload = ftp_put($conn, $target, $source, FTP_ASCII);
if (!$upload) { echo 'FTP upload failed!'; }

Just to be clear, as it's rather buried in comments on another answer:

"The parameter is incorrect" is caused by an invalid destination filename. Make sure you don't have any invalid characters (slash, colon, etc...) in your filename.