CoreyH
CoreyH

Reputation: 544

PhpSpreadsheet load Excel file from memory rather than a file?

I'm downloading an Excel file from an Azure Storage Blob and therefore want to use stream_get_contents to get the file. But PhpSpreadsheet seems to only want to read the file off the filesystem.

For now, I'm saving it to a temp folder and reading it back, but that is less than ideal.

Is there a way to get PhpSpreadsheet to load via something other than a local file?

Upvotes: 3

Views: 3391

Answers (1)

PowerKiKi
PowerKiKi

Reputation: 4748

This is not supported. PhpSpreadsheet will always read from disk.

On a side note, since 1.13.0, PhpSpreasheet is able to write in memory. See https://github.com/PHPOffice/PhpSpreadsheet/pull/1292

Upvotes: 4

Related Questions