Answer the question
In order to leave comments, you need to log in
Copying xml file from url to ftp on schedule?
There is an xml file url on another server (just a link, no access). It is necessary to copy this file to itself on ftp according to the schedule. Tell me, please, is this possible? The site is on wordpress, so maybe there are suitable plugins?
Answer the question
In order to leave comments, you need to log in
<?php
function downloadXML($file_url, $save_to)
{
$content = file_get_contents($file_url);
file_put_contents($save_to, $content);
}
// Yandex Metrika
downloadXML('https://example.com/file.xml', realpath("./xml") . '/file.xml');
?>
https://example.com/file.xml
replace with the url of the file you need. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question