我正在尝试使用PHP cURL上传和覆盖我的ftp服务器上的CSV。
它运行并且没有错误但是当我继续使用FTP时,它没有上传任何内容。我已经删除了用户名并从下面传递但是它们将被填写。
$url4 = "ftp://username:password@ip/folder/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url4);
$postData = array(
'testData' => '@csv/output/list.csv',
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
// upload file
if (curl_exec($ch))
{
echo "Successfully uploaded.<br />";
}
else
{
echo "Error uploading.<br />";
}
// close connection
curl_close ($ch);
//End of Uploading the FTP file