I upload XML file through FTP:
$ftp = "ftp";
$username = "username";
$pwd = "password";
$filename = $_FILES[$xyz][$abc];
$tmp = $_FILES['file']['tmp_name'];
$destination = "/Content/EnquiryXML ";
$connect = ftp_connect($ftp)or die("Unable to connect to host");
ftp_login($connect,$username,$pwd)or die("Authorization Failed");
echo "Connected!<br/>";
if(!$filename)
{
echo"Please select a file";
}
else
{
ftp_put($connect,$destination.'/'.$filename,$tmp,FTP_ASCII)or die("Unable to upload");
echo"File successfully uploaded to FTP";
}
I want to send the XML file created using DOMDocument
to a FTP server but I am not able.
The ftp_put
returns false.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…