-
Notifications
You must be signed in to change notification settings - Fork 6
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
file_put_contents(/vagrant/public/test.pdf8O1RWi): failed to open stream: Permission denied #7
Comments
Also this is the method that is throwing the error: if (false === @file_put_contents($tmpFile, $content)) { in symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php. |
Directory in which you are trying to write, have to be writable. |
drwxrwxrwx 1 vagrant vagrant 272 Jan 18 15:23 quotes The directory is writeable so I do not believe that this is the issue. As I mentioned above every time return PDF::loadView('quotes.forward', compact('job', 'admin'))->save('/vagrant/public/test.pdf'); is run, a new file is created in the app/storage directory that begins test.pdf but that is followed by a random string. For example, I just ran the function 4 times and this is what was produced within app/storage: -rw------- 1 vagrant vagrant 0 Jan 18 15:29 test.pdf489Djm I had a look through the src but I couldn't see anywhere obvious the random string was being added (though I will admit some of the code went over my head). |
I'm an idiot, turns out you (and the error message!) were correct all along. Using Vagrant was causing some permission issues which once sorted mean't that this behaved perfectly. Thanks again! |
Me again 😄, I am having varying success with this package...
This is the code I am using at the moment:
It will stream and download the output but when I try and save it I get the above message. I have tried changing the directory but it makes no difference. A blank file is created in the correct directory with the title matching the error (in this case /test.pdf8O1RWi)
I cannot work out what is causing the random string to be appended at the end of the filename or how to fix this problem.
The output pdf that it is producing when it streams/downloads is excellent.
The text was updated successfully, but these errors were encountered: