Image Postprocessing
Folks, how do I get the path of an uploaded image? (I want to edit this image by sending it to an API, then replace it)
This just returns storage/app/livewire-tmp, and not the actual path of the uploaded image π¦
Thanks in advance!
Also, would it be better to do this after the form is submit, then replace it? I'm not sure..
5 Replies
Hi, your file has not yet been uploaded, it is in the temporary files. It's up to you to determine the path in which you want to store it. You can, however, retrieve the file name.
Thank you @Alex'R. How can I send it to an API after it has been submit/upload, to fix it? Is that the correct event?
you can do it in handleRecordCreation or handleRecordEdition method : https://filamentphp.com/docs/3.x/panels/resources/creating-records#customizing-the-creation-process
Awesome, thanks! I've got
image
as a key in:
how do I resolve the image
path to an actual path? it simply gives me for example:
depends of your storage configuration
explore your storage folder and you get the path with storage_path() method
if you want the file is public, you should use public as FILESYSTEM_DISK in your .env and use php artisan storage:link, instead you can use publicly