Set temporary file location? #644
brandonjbegle
started this conversation in
General
Replies: 1 comment 3 replies
-
Try the setCustomTempPath function - it solved the problem for me For example Browsershot::html('<p></p>')->setCustomTempPath(storage_path())->pdf(); |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to set the temporary file directory?
In Browsershot.php, lines 780-785, in the function createTemporaryHtmlFile(), a new TemporaryDirectory() is created in the system temp directory. However, this doesn't work when using Laravel Homestead if chromium is installed with snap, since snap prevents file access pretty much beyond the home directory.
I see that there is a location() function on the TemporaryDirectory class, but I can't see any way to set it beyond hardcoding something like
$this->temporaryHtmlDirectory = (new TemporaryDirectory())->location('/home/vagrant/tmp')->create();
inside the actual package function.
Thanks,
Brandon
Beta Was this translation helpful? Give feedback.
All reactions