Comments (7)
Ok the issue was the saveTo
, I had been focusing on the source files.
It's fixed, with a test case specifically setup for your scenario:
laravel-zipstream/tests/ZipTest.php
Lines 25 to 36 in 61d0482
Version 1.7 is released with this fix.
from laravel-zipstream.
That means those files don't exist on disk, or aren't readable. Double check that /tmp/test.pdf
and /tmp/test2.pdf
are present with proper permissions?
In v1.6 we introduced the ability to create a zip entry from raw data. At the moment you can see the logic used to determine whether a filepath on disk was provided, and if it's not a valid path we assume it's raw data instead:
laravel-zipstream/src/Models/File.php
Lines 55 to 59 in 030a943
The exception you're getting means the above check did not find a valid file on disk, assumed it was raw file data, and passing raw data absolutely requires providing an explicit filename with extension.
Hope that helps, let me know if that doesn't solve the issue.
from laravel-zipstream.
Files are in place (1.5 works normally)
from laravel-zipstream.
I double checked, all files exist and still getting this error.
also is this function correct? it returns the filename of the file not a path?
/**
* @return string
*/
protected function getDefaultZipPath()
{
return basename($this->getSource());
}
from laravel-zipstream.
Mmm seems that the code wants to "add" the zipfile to the archive?
$files = [
'/tmp/test.pdf',
'/tmp/test2.pdf',
];
// Zip it
Zip::create('file.zip', $files)
->saveTo(storage_path('app/tmp'));
This will add, test.pdf
, test2.pdf
and file.zip
to the archive. So file.zip
does not exists and it tries to add it as a TempFile
... Thats producing the error...
I think it has to do with this line
laravel-zipstream/src/ZipStream.php
Line 253 in 030a943
from laravel-zipstream.
from laravel-zipstream.
Thanks!!
from laravel-zipstream.
Related Issues (20)
- saveTo method has permission denied error on manjaro without webserver HOT 1
- Grant public-read access HOT 1
- Update maennchen/zipstream-php package HOT 2
- Space & Specials Character are being replaced by "%" sign HOT 1
- Compatibility with PHP 8.2 HOT 2
- Always downloading as a html file with incorrect name HOT 4
- Unable to install package. HOT 9
- get_headers(): SSL: Connection reset by peer HOT 2
- The name of the file being downloaded is “download” without extension HOT 7
- ZipStream v3 Beta HOT 9
- Unexpected end of Archive HOT 1
- S3File memory leak on calculateFilesize HOT 11
- Cache file size HOT 6
- ErrorException: fopen(): s3:// wrapper is disabled HOT 1
- Filename sanitization HOT 2
- Laravel 10 Support HOT 1
- The package gets http file headers anyway even when filesize prediction is disabled
- Feature request: Check if file exists and/or append $var to filename HOT 3
- Unable to use Zip HOT 1
- Merge zip - source from s3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-zipstream.