Fileupload

File upload isn't working as expected in panel builder. I get type error when I add image() validation even when I'm uploading an image and when I dd() the data, image column returns null
No description
18 Replies
LeandroFerreira
LeandroFerreira5mo ago
provide more info/code did you try another image?
KingNii
KingNiiOP5mo ago
@Leandro Ferreira Yes I have tried other images and got the same results
FileUpload::make('biker_license_image')
->disk('s3')
->image()
->visibility('private')
// ->preserveFilenames()
->directory('biker-attachments'),
FileUpload::make('biker_license_image')
->disk('s3')
->image()
->visibility('private')
// ->preserveFilenames()
->directory('biker-attachments'),
No description
awcodes
awcodes5mo ago
Just as a test can you try explicitly setting the acceptedFileTypes() to like image/jpg etc.? I’m wondering if your server just isn’t determining the mime type properly.
KingNii
KingNiiOP5mo ago
@awcodes This is the results
No description
No description
awcodes
awcodes5mo ago
Hmm. This leads me to think it’s something on the server and not filament. Like it can’t infer the mime type or the images you’re testing with aren’t properly encoded.
KingNii
KingNiiOP5mo ago
@awcodes So I'm using form builder in the frontend part of the application and I'm not facing this issue
awcodes
awcodes5mo ago
That’s even more weird then. The forms package is the same in stand alone or panels. That just doesn’t make sense.
KingNii
KingNiiOP5mo ago
@awcodes Exactly I should mention I'm building in docker
awcodes
awcodes5mo ago
I wouldn’t think docker would matter. I could be wrong though, I don’t use it. Can you test it locally without the s3 disk, maybe it has something to do with trying to read the temp file from local/s3 bucket and it can’t read it. Ie, possibly a permissions issue on the bucket.
awcodes
awcodes5mo ago
Laravel
File Uploads | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
KingNii
KingNiiOP5mo ago
@awcodes Same results but I seem to remember something about file permissions error when I implemented the resource
awcodes
awcodes5mo ago
Yea. My brain is just saying it’s something outside of filament itself.
KingNii
KingNiiOP5mo ago
@awcodes I just pushed my code to test on my development domain and I'm getting the same error
awcodes
awcodes5mo ago
Yea. If it’s something with s3 then the app server won’t matter. Did you try the link I posted to force the tmp uploads to the s3 disk instead of local?
KingNii
KingNiiOP5mo ago
Yes it did! Thank you. Apologies for the late reply
Sivan
Sivan5mo ago
Hi everyone, How can we set up image uploads locally? Is it possible?
Sivan
Sivan4mo ago
Thanks @Dimitar Papazov DEV
Want results from more Discord servers?
Add your server