F
Filament•2y ago
ericmp

How to upload mp3 files using FileUpload?

this is what im trying:
FileUpload::make('audio')
->previewable(false)
// ->
// ->acceptedFileTypes([
// 'mp3',
// 'wav',
// ])
,
FileUpload::make('audio')
->previewable(false)
// ->
// ->acceptedFileTypes([
// 'mp3',
// 'wav',
// ])
,
but i get
No description
44 Replies
ericmp
ericmpOP•2y ago
No description
ericmp
ericmpOP•2y ago
can i upload audio files? with pdfs and images it works, but when uploading an mp3 it doesnt
ericmp
ericmpOP•2y ago
okay now i have it like this: 'audio/mpeg3', but i get:
ericmp
ericmpOP•2y ago
No description
ericmp
ericmpOP•2y ago
also tried audio/mp3, same error but instead of "audio/mpeg3" says "audio/mp3"
awcodes
awcodes•2y ago
It could be anyone of those mime types. audio/mp3 audio/mpeg audio/mpg audio/x-mp3 audio/x-mpeg audio/x-mpeg3 audio/x-mpegaudio audio/x-mpg
ericmp
ericmpOP•2y ago
ericmp
ericmpOP•2y ago
havent uploaded never an mp3 to a laravel project and dont understand it
awcodes
awcodes•2y ago
Not sure. Livewire is having trouble with the file for some reason.
ericmp
ericmpOP•2y ago
thats why i ask if i can use it to upload audio files it may doestn accept it or something
awcodes
awcodes•2y ago
I’m sure it does.
ericmp
ericmpOP•2y ago
also, ive tried with other mp3 files, in case that one is corrupt but no luck
awcodes
awcodes•2y ago
Maybe ask in the livewire discord. I’m not sure this is a filament issue.
ericmp
ericmpOP•2y ago
yeah, well, never got any response there, never but thanks (: appreciete ur time
ericmp
ericmpOP•2y ago
No description
ericmp
ericmpOP•2y ago
no, since isn't a 500, but 422 nah, havent found how to fix it so far
einnlleinhatt_
einnlleinhatt_•2y ago
@ericmpdo you have a livewire config ?
ericmp
ericmpOP•2y ago
not sure, how to check that?
einnlleinhatt_
einnlleinhatt_•2y ago
In your config folder
ericmp
ericmpOP•2y ago
okay, so i dont have it let me php artisan livewire:publish --config done, now?
einnlleinhatt_
einnlleinhatt_•2y ago
try upload again
ericmp
ericmpOP•2y ago
just tried same
einnlleinhatt_
einnlleinhatt_•2y ago
squint
einnlleinhatt_
einnlleinhatt_•2y ago
No description
ericmp
ericmpOP•2y ago
really u use valet?
einnlleinhatt_
einnlleinhatt_•2y ago
ehh no
ericmp
ericmpOP•2y ago
okay hmmm
einnlleinhatt_
einnlleinhatt_•2y ago
i use laragon
ericmp
ericmpOP•2y ago
im on windwos too
einnlleinhatt_
einnlleinhatt_•2y ago
šŸ¤”
ericmp
ericmpOP•2y ago
PHP 8.1.6
einnlleinhatt_
einnlleinhatt_•2y ago
Can i see your audio database / Im using php 8.1 too
ericmp
ericmpOP•2y ago
wdym by my audio database?
einnlleinhatt_
einnlleinhatt_•2y ago
Like the schema
ericmp
ericmpOP•2y ago
but im not using any model here, at the moment i just want the file to get uploaded to the filament form action i also added ini_set('post_max_size', '64M'); ini_set('upload_max_filesize', '64M'); when i get to get the file in the form action, then ill see how to link it to my model, but at the moment im trying to get the file in the backend action
einnlleinhatt_
einnlleinhatt_•2y ago
Im not sure then šŸ˜µā€šŸ’« I did have a model for it tho
ericmp
ericmpOP•2y ago
look, for the image it works, but for the audio file doesnt
No description
ericmp
ericmpOP•2y ago
and i havent linked it to any model yet neither maybe is cuz i have it in a modal ill try to move the form action outside the filament table, as a full page form action, lets see
einnlleinhatt_
einnlleinhatt_•2y ago
I have no idea then 🫠
ericmp
ericmpOP•2y ago
dont worry, thanks for the help (,:
einnlleinhatt_
einnlleinhatt_•2y ago
Good luck to you
ericmp
ericmpOP•2y ago
oh i think i found what is going on. im using an EditAction if i change it to Action, works since the edit action expects the field to be in the model i guess so u got the point there. hmm but im using spatie media lib, lets see how can i make this to work
einnlleinhatt_
einnlleinhatt_•2y ago
Nice

Did you find this page helpful?