How to upload mp3 files using FileUpload?
this is what im trying:
but i get
44 Replies
can i upload audio files?
with pdfs and images it works, but when uploading an mp3 it doesnt
You have to provide the right mime type not the file extension.
https://mimeapplication.net/audio-mpeg3#:~:text=This%20MIME%20type%20falls%20under,to%20refer%20to%20this%20format.
okay now i have it like this:
'audio/mpeg3',
but i get:
also tried audio/mp3, same error but instead of "audio/mpeg3" says "audio/mp3"
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
but i wasnt asking about this actually, i was asking about this:
https://cdn.discordapp.com/attachments/1167900740728139888/1167900740900102254/image.png?ex=654fcf53&is=653d5a53&hm=079efcda6ade8065d6c7ace70b9efbd642e28cb578cdb96f667653debdc71837&
i dont undesrtand why unpreocessable content?
havent uploaded never an mp3 to a laravel project and dont understand it
Not sure. Livewire is having trouble with the file for some reason.
thats why i ask if i can use it to upload audio files
it may doestn accept it or something
Iām sure it does.
also, ive tried with other mp3 files, in case that one is corrupt
but no luck
Maybe ask in the livewire discord. Iām not sure this is a filament issue.
yeah, well, never got any response there, never
but thanks (:
appreciete ur time
no, since isn't a 500, but 422
nah, havent found how to fix it so far
@ericmpdo you have a livewire config ?
not sure, how to check that?
In your config folder
okay, so i dont have it
let me php artisan livewire:publish --config
done, now?
try upload again
just tried
same
really
u use valet?
ehh no
okay
hmmm
i use laragon
im on windwos too
š¤
PHP 8.1.6
Can i see your audio database /
Im using php 8.1 too
wdym by my audio database?
Like the schema
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
Im not sure then šµāš«
I did have a model for it tho
look, for the image it works, but for the audio file doesnt
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
I have no idea then š«
dont worry, thanks for the help (,:
Good luck to you
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
Nice