Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"STS\ZipStream\Exceptions\FilenameMissingException" Unable to add file but file exists #16

Closed
XanCeegor opened this issue Jan 3, 2020 · 2 comments

Comments

@XanCeegor
Copy link

$zip_file = Zip::create("myfile.zip");
$zip_file->add(storage_path('app/files/qPygS13dEaa8KTDnzvx69fVBwqXiSJl6YX06NvcJ.pdf'));
return $zip_file;

Hi. I'm using the above code to try and ZIP a PDF file on my local Laravel machine but I get the exception in the title. The file definitely exists. This happens for all files I try to add.
When I use return response()->download(storage_path('app/files/qPygS13dEaa8KTDnzvx69fVBwqXiSJl6YX06NvcJ.pdf')); as a test it returns the file correctly.

Is there something that I'm doing wrong? My dev enviroment is a Win10 machine with XAMPP running for dev purposes.
Any help would be great!
Thanks.

@jszobody
Copy link
Member

jszobody commented Jan 3, 2020

Upgrade to v2.1 and try again.

This package assumed that local filepaths start with a forward slash, and that's not going to be the case on Windows. I believe I just resolved it in v2.1. I don't have a Windows dev machine to test on, let me know if it's still giving you issues.

@jszobody jszobody closed this as completed Jan 3, 2020
@XanCeegor
Copy link
Author

Hi.
This did indeed solve my problem.
Thank you for this package! It's way faster than the other package I was using and the fact that it doesn't store the archive file on the server first is awesome!

Happy new year by the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants