i want to download some .zip files with php from a xml file...
Example of XML Code:
<Index> <Package unzip="false" ignore="false"> <FileSize val="xxxxx" /> <FileName val="folder1:file1.zip" /> <Language val="all" /> </Package> <Package unzip="false" ignore="false"> <FileSize val="xxxxx" /> <FileName val="folder2:file2.zip" /> <Language val="all" /> </Package> </Index>
As you can see in Filename there are different (unknown) specifications where the files are on my server... for example in folder1 there is file1.zip
And when i download them i also want them in the defined folders, so i want to have file1.zip in folder1
So here is my php Code, i've got all the filenames and folders (changed : to /) but i cannot download them
php Code: `
$sxe = simplexml_load_file(test.xml');
foreach($sxe->xpath('//FileName/@val') as $item) {
$item = str_replace(":", "/", $item); file_put_contents($item, fopen('http://aServer.com/'.$item, 'r'));
} `
Output error: failed to open stream: No such file or directory
Will be thankful for every help