What is the limit that's set. And try chunking.
Jun 6, 2024
7
Level 1
413 Request Entity Too Large
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
<html>
<head>
<title>413 Request Entity Too Large</title>
</head>
<body>
<center>
<h1>413 Request Entity Too Large</h1>
</center>
<hr>
<center>nginx/1.24.0</center>
</body>
</html>
my laravel application is hosted on railway. Please how can i solve this problem
Please or to participate in this conversation.