mirkin93
2 months ago
231
1
Laravel

" added to path?

Posted 2 months ago by mirkin93

In one of my directories I receive XML files which are posted by a post request.

With SimpleXML I want to read them and put the data in the database, I have the following code for testing:

foreach(Storage::files('xml') as $file)
{
    $xml = simplexml_load_file(storage_path($file));
    return $xml;
}

But it returns the error: simplexml_load_file(): I/O warning : failed to load external entity "/home/user/web/domain.com/public_html/storage/xml/50e87b5d19446cf81764d896a8a81d76.xml"

Why is " added to the file path?

Please sign in or create an account to participate in this conversation.