Closed damarinov1 closed 1 week ago
I Have The same issue
Typed property STS\ZipStream\Models\File::$filesize must not be accessed before initialization
I update this method in HttpFile
public function canPredictZipDataSize(): bool
{
return (array_key_exists(self::HEADER_CONTENT_LENGTH, $this->getHeaders()));
}
It's a bug?
I believe that in php 8, variables that are typed must have a default value.
If I add a default value to $filesize everything works.
Alternatively we can set $filesize to null.
@damarinov1 @lorenzoalulithos I just pushed a fix and tagged v5.1.
Laravel 10 PHP 8.2
Hi,
I am updating a project that is using your library since version 2.4. Now, I am updating up to Laravel 10 and updated your library to the latest version (5.0.2).
I am using the library to zip XLSX files that are generated from reports. For some reason, after the update, now, the files inside the zip are not stored correctly and corrupted. The zip size is 632 bytes and the files inside are 71 bytes. Here's how I am using it:
I've tried the same exact logic from above, manually in tinker. The zip was perfect. For some reason, during code execution something is happening that I cannot catch.
Any ideas, suggestions what could I be missing? Some config?
Edit: I saw that it doesn't like Spatie's media library. In what sense they are in conflict? Here, in this example these files are not in any way using the media library.
Thanks in advance.
Edit2: I've edited the path to the file. Before I was sending relative url to the files, for example
storage/reports/test.xlsx
and I've changed it to full url (https://localhost/storage/reports/test.xlsx
)And now when I get to save the zip I've got this error
What does this error mean? Any help would be appreaciated