3
In php using the command var_dump($_FILES ['filexml']);
I receive the following values from ajax
array(5) {
["name"]=>
string(56) "nomeficticio.xml"
["type"]=>
string(8) "text/xml"
["tmp_name"]=>
string(14) "/tmp/phpoqnomeficticio"
["error"]=>
int(0)
["size"]=>
int(16536)
}
Through this data, how can I read this XML file? with PHP
I even tried to use the command simplexml_load_file($_FILES['filexml']);
but made the following mistake:
simplexml_load_file() expects Parameter 1 to be a Valid path, array Given
You are passing the entire array as parameter, while you need the path of a file to read. I think, in your case,
simplexml_load_file($_FILES['filexml']['name'])
is the most appropriate, as long as the path in this array field is the correct one– Caio Felipe Pereira
@Caiofelipepera Hmmm, I need to upload first so I can read the XML? or I can read the xml without necessarily uploading it (save to some directory)
– Silvio Andorinha
The guys already got the jump right there, hahaha. But the thing was kind of
– Caio Felipe Pereira