I'm very new to Laravel, using Laravel with Inertia, React.
I'm trying to make something like Livewire's temporary upload system,
What I'm currently doing is, I have a specific route to store user's uploaded image to a temporary directory.
then send the temporary image path to the front-end.
Now when the user submits the form, I'm sending the temporary image path to the controller.
Now I need to validate the image, like the image actually exists, it's the appropriate size.
Why don't you validate the image before you store it in the temporary folder, and if all good and then the user submits the form, you just move it to the new directory where it is supposed to go?
Livewire does that as long as you add a validation rules.
@Nakov That I also thought, but at the end (on final form submit) we are submitting the uploaded image path, as it's just a string, anyone can modify it. we need to verfiy that, right?