sergiorodenas / stream-parser

⚡ PHP7 / Laravel Multi-format Streaming Parser
MIT License
439 stars 46 forks source link

Getting error while trying to open an xml file #31

Closed kubila closed 4 years ago

kubila commented 4 years ago

I'm getting this error while trying to read a file, using Laravel 7.

XMLReader::open(): Unable to open source data

The file is like this, in local disk, size is about 10 MB. `

Stone 0.00 0.00 0.00 0.00 0 2020/2021 0 No No No No No 5f1fe1d3a56d3a88364d.jpg ` with this code ` StreamParser::xml(storage_path('products\products.xml'))->each(function (Collection $product) { var_dump($product); var_dump($product->get('Images')); });` Any idea why this is happening?
kubila commented 4 years ago

Such a mistake that was, your path should include "app" folder too, you should use this Storage::path('products\products.xml') instead of storage_path('products\products.xml').