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
LeandroFerreira3mo ago
provide more info/code did you try another image?
KingNii
KingNii3mo 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
awcodes3mo 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
KingNii3mo ago
@awcodes This is the results
No description
No description
awcodes
awcodes3mo 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
KingNii3mo ago
@awcodes So I'm using form builder in the frontend part of the application and I'm not facing this issue
awcodes
awcodes3mo 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
KingNii3mo ago
@awcodes Exactly I should mention I'm building in docker
awcodes
awcodes3mo 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
awcodes3mo ago
Laravel
File Uploads | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
KingNii
KingNii3mo ago
@awcodes Same results but I seem to remember something about file permissions error when I implemented the resource
awcodes
awcodes3mo ago
Yea. My brain is just saying it’s something outside of filament itself.
KingNii
KingNii3mo ago
@awcodes I just pushed my code to test on my development domain and I'm getting the same error
awcodes
awcodes3mo 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
KingNii3mo ago
Yes it did! Thank you. Apologies for the late reply
Sivan
Sivan3mo ago
Hi everyone, How can we set up image uploads locally? Is it possible?
Sivan
Sivan2mo ago
Thanks @Dimitar Papazov DEV
Want results from more Discord servers?
Add your server