Giter Site home page Giter Site logo

Comments (7)

RTippin avatar RTippin commented on May 18, 2024

Can you please relay the exact message the API returns? 422 isn't anything to go off of alone, need the context from the message to know why your upload didn't pass validation.

from messenger.

azamalvi avatar azamalvi commented on May 18, 2024

Can you please relay the exact message the API returns? 422 isn't anything to go off of alone, need the context from the message to know why your upload didn't pass validation.

image

Status Code: 422 Unprocessable Content

from messenger.

RTippin avatar RTippin commented on May 18, 2024

You mentioned you adjusted your Nginx conf to allow 20mb, but did you also update your php.ini's post_max_size and upload_max_filesize ?

from messenger.

azamalvi avatar azamalvi commented on May 18, 2024

Yes the values are ok because I can upload more then 3mb of images as well. Only issue is with the Audio file

from messenger.

RTippin avatar RTippin commented on May 18, 2024

I would say to check your config/env for the audio size:

'size_limit' => env('MESSENGER_MESSAGE_AUDIO_SIZE_LIMIT', 10240),

But the error you are getting is not a validation error from a file being too big. It's beyond my package/framework and something to do with your server/environment itself. May want to check your server/nginx logs.

from messenger.

azamalvi avatar azamalvi commented on May 18, 2024

Config is default.

'message_audio' => [ 'upload' => env('MESSENGER_MESSAGE_AUDIO_UPLOAD', true), 'size_limit' => env('MESSENGER_MESSAGE_AUDIO_SIZE_LIMIT', 10240), 'mime_types' => env('MESSENGER_MESSAGE_AUDIO_MIME_TYPES', 'aac,mp3,oga,ogg,wav,weba,webm'), ],

I have also checked the logs and did not find any errors. Can you please try it on your local with audio file only. It should be more then 2mb.
Thanks

from messenger.

RTippin avatar RTippin commented on May 18, 2024

I have no issues uploading a 5mb audio file myself, and as I said, the error you are getting from the failed validation is not an issue with my package. I use laravels file validations here:

private function generateAudioRule(): void
{
$limit = Messenger::getMessageAudioSizeLimit();
$mimes = Messenger::getMessageAudioMimeTypes();
$this->generatedRuleset['audio'] = ['required', "max:$limit", 'file', "mimes:$mimes"];
}

Sounds to me like your audio file is corrupt or something in your environments that is not clear to me.

from messenger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.