Get image size from file upload
I need to get the image size from the file upload form component and send that over an api resource. I can't seem to find anything about this in the docs, any ideas?
6 Replies
?
Won’t state be a string at this point?
Would probably need to do it saveUploadedFileUsing() so you’d have access to the temporary file upload.
I guess you could do it in afterStateUpdated() using the Storage facade to get that data from the file.
state is a Livewire\TemporaryUploadedFile i think
This actually works! However I actually need to call the getimagesize method as I need the width & height of the image (should've been more specific😅 ). In which case, it doesn't work
try
getimagesize($state->getRealPath())
That did the trick, thanks!