Answer the question
In order to leave comments, you need to log in
How to save the generated xml file in the root of the site on Bitrix?
A new xml file is created in the init.php file. It must be saved in the \upload\tmp site folder.
The following code saves the file if you test the code locally on your computer. But when working with Bitrix files, the file is no longer saved.
$dom = new domDocument("1.0", "utf-8");
$root = $dom->createElement("congrats");
$dom->save($_SERVER['DOCUMENT_ROOT']."\upload\tmp\congrats.xml");
$fileSave = CFile::SaveFile(
$dom,
'tmp',
false,
false
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question