cloudinary-laravel icon indicating copy to clipboard operation
cloudinary-laravel copied to clipboard

413 Request Entity Too Large

Open Ngozistephen opened this issue 1 year ago • 0 comments

I am uploading files to cloudinary with this code

public function upload(Request $request) { $folder = 'product_photo';

    if ($request->hasFile('photo')) {
        $file = $request->file('photo');
        request()->validate([
            'photo' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:6048',
           
        ]);

        $cloudinaryResponse = Cloudinary::upload($file->getRealPath(), [
            'folder' => $folder,
        ]);

        $secureUrl = $cloudinaryResponse->getSecurePath();
        return response()->json(['secure_url' => $secureUrl], 200);
    } else {
        return response()->json(['error' => 'No file uploaded'], 400);
    }
}

the problem is that it works on local but on production it shows this error message

413 Request Entity Too Large

413 Request Entity Too Large


nginx/1.24.0

Ngozistephen avatar Jun 06 '24 21:06 Ngozistephen