mercredi 17 février 2016

File upload to cloudinary working fine locally but not in heroku in a laravel application

I am working on a Laravel app which allows users to upload mp3 files which are stored in Cloudinary. Locally, uploading the files works fine but in Heroku I get a validation error that the file is missing. I can't really see why I am getting the validation error. I get this error when I try uploading a file that's still within the PHP max file upload limit i.e. 8.6MB. However, if I try uploading a file greater than 8.6 MB I get a Service Unavailable 503 error with -

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. What could be the problem?

This is the code to the store method in my Controller

public function store(Request $request)
{
    $this->validate($request, [
        'title'         => 'required|min:3',
        'description'   => 'required',
        'channel'       => 'required',
        'podcast'       => 'required|size_format'
    ]);

    $data    = [
        'episode_name'          => $request->title,
        'episode_description'   => $request->description,
        'channel_id'            => $request->channel,
        'image'                 => self::DEFUALT_COVER_IMAGE,
        'audio_mp3'             => $this->upload->videoToCloudinary($request->podcast),
        'view_count'            => 0,
        'status'                => 0
    ];

    $this->episodeRepository->createEpisode($data);

    return redirect()->back()->with('status', 'Nice Job! ' . $request->title . ' is held for moderation.');
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire