413 Request Entity Too Large on Production but it uploads on Local server
ngozistephen
TRIALOP

2 years ago

this is my codepublic 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);}

}

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

my laravel application is hosted on railway.

Please how can i solve this problem

5 Replies


ngozistephen
TRIALOP

2 years ago

is not working



ngozistephen
TRIALOP

2 years ago

that is the upload file size limit for Pro Plan


2 years ago

There are no such restrictions tied to the plan type, I'm not sure where you got that idea from, this is purely a configuration issue.

Please attach your build logs otherwise I unfortunately will not be able to assist further.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...