php download multiple .zip files from xml -
I want to download some .zip files from php with an XML file ...
Example XML Code:
& lt; Index & gt; & Lt; Package unzip = "false" ignore = "wrong" & gt; & Lt; FileSize val = "xxxxx" /> & Lt; Filename val = "folder1: file1.zip" /> & Lt; Language val = "all" /> & Lt; / Package & gt; & Lt; Package unzip = "false" ignore = "wrong" & gt; & Lt; FileSize val = "xxxxx" /> & Lt; Filename val = "folder2: file2.zip" /> & Lt; Language val = "all" /> & Lt; / Package & gt; & Lt; / Index & gt;
As you can see in the filename, there are different (unknown) specification where the files are on my server ... For example, file1.zip in folder1 is
and when I download them, I also have to do them in defined folders, so I have to keep file1.zip in Folder 1
< P> So here's my PHP code, I've got all the filenames and folders (changed: from /) but I downloaded them Can tphp code: `
$ sxe = simplexml_load_file (test.xml ');
Foreign currency ($ sxe-> xpath ('// filename / @well') as $ item) {
$ item = str_replace (":" , "/", $ Item); File_put_contents ($ item, fopen ('http://aServer.com/'. $ "',' R '));
} Output error: Failed to open the stream: No such file or directory
for each help Be grateful
Comments
Post a Comment