File Upload 422 Error

{
"message": "The files.0 failed to upload.",
"errors": {
"files.0": [
"The files.0 failed to upload."
]
}
}
{
"message": "The files.0 failed to upload.",
"errors": {
"files.0": [
"The files.0 failed to upload."
]
}
}
Can't upload a images it gives me a error above on reponse
No description
26 Replies
joemardevs
joemardevsOP15mo ago
Code on my file upload
No description
toeknee
toeknee15mo ago
Try removing image and optimise. Does it work?
joemardevs
joemardevsOP15mo ago
same error
toeknee
toeknee15mo ago
What type of file are you uploading?
joemardevs
joemardevsOP15mo ago
jpg also png
toeknee
toeknee15mo ago
Can you find it in your temporary storage path?
joemardevs
joemardevsOP15mo ago
i can't see
toeknee
toeknee15mo ago
Make sure to run php artisan storage:link
joemardevs
joemardevsOP15mo ago
The error is showing when im gonna upload a above 2MB size but the rules on my livewire is null If im gonna upload a below it will success idk why, but i dont have a validation for size tho yes i already run it
einnlleinhatt_
einnlleinhatt_15mo ago
@Joemar maybe your php setting like upload limit things
joemardevs
joemardevsOP15mo ago
No description
joemardevs
joemardevsOP15mo ago
but its set to 2G which is 2 Gigabytes
einnlleinhatt_
einnlleinhatt_15mo ago
Does the Laravel log say anything?
joemardevs
joemardevsOP15mo ago
says "The files.0 failed to upload."
ModestasV
ModestasV15mo ago
Is there anything in laravel.log file?
einnlleinhatt_
einnlleinhatt_15mo ago
I mean the full Laravel log
joemardevs
joemardevsOP15mo ago
where i can found this?
ModestasV
ModestasV15mo ago
storage/logs/laravel.log
joemardevs
joemardevsOP15mo ago
its empty
joemardevs
joemardevsOP15mo ago
No description
joemardevs
joemardevsOP15mo ago
Thanks guys already found a solution
ChesterS
ChesterS15mo ago
No description
toeknee
toeknee15mo ago
And what was it?
joemardevs
joemardevsOP15mo ago
The problem is the
max_upload_size
max_upload_size
on the php.ini
einnlleinhatt_
einnlleinhatt_15mo ago
2g is not enough? 😱
joemardevs
joemardevsOP15mo ago
idk but i changed it to 12M and it works

Did you find this page helpful?