SriChakra's avatar

Unable to upload audio file

Hello,

I am trying to upload a audio file. Initially i got 413 Request Entity issue. I resolved it Later, I tried to upload the audio again, there is no 413 Request Entity issue. But the audio is not being uploaded I am trying to save it in public/storage folder. Can anyone help me on this issue

0 likes
15 replies
tisuchi's avatar

@srichakra The 413 HTTP issue means the file is too large. Check more here

Besides, make sure that you have enctype='multipart/form-data' in your form. If you are curious to know when and why we need to use enctype, then check this

FYI, you can check this tip also for audio file upload in laravel.

1 like
SriChakra's avatar

Hi @tisuchi The audio file being uploaded in local environment. But when uploading in server the file is not being uploaded. Initially we got 413 message. But now after making changes we are not getting that message. But the audio file is not being uploaded. Is there anything we can do on the server side

SriChakra's avatar

Hi @Snapey No it's not working with smaller files even. Initially the audio file was 41mb and i compressed it to 6mb. The file didn't upload. I tried with even less sized files. But i didn't find any luck at all. But in local it's working fine

Tray2's avatar

@SriChakra You need to share your code, otherwise it's ompossible for us to guess what is wrong.

Snapey's avatar

@SriChakra if it's shared hosting it's likely to be limited for images, eg like 2mb

don't forget it will take much longer to upload to a remote server. if you have adsl it's likely to be like 1/10th the speed of downloads

Tray2's avatar

@SriChakra So you get no errors while uploading the file?

Check the log for any errors not shown.

Try removing the authorization from your storeAudio method.

BTW please copy and paste the code into your query instead of linking to images.

SriChakra's avatar

@Sinnbeck I am not redirected back to welcome route. I am staying on same create audio route, once the audio is uploaded. Redirection is not happening because the file is not uploaded

Snapey's avatar

tried it with a 2k file?

It could be anything since you don't validate. So you could for instance just upload a php file and then execute it !

Please or to participate in this conversation.