I am using this GLPI API and I am trying to upload a file.
Here's what I am doing in my code:
public static function uploadDocument(TicketRequest $request)
{
$client = new static();
if ($request->hasFile('file')) {
$file = $request->file('file');
$file_name = $file->getClientOriginalName();
$uploadManifest = [
"input" => [
"name" => $request['document_title'],
"_filename" => [$file_name],
],
];
$result = $client->upload("Document", [
'uploadManifest' => json_encode($uploadManifest),
'filename[0]' => '@' . $file->getPathname(),
]);
}
}
But I always get the error ERROR_UPLOAD_FILE_TOO_BIG_POST_MAX_SIZE
You're getting a
ERROR_UPLOAD_FILE_TOO_BIG_POST_MAX_SIZEbecause the file you're trying to upload is larger than the limit configured on your server.It won't happen if you reduce the size of the file you're uploading.
You need to increase the upload limit on your server. You can do this by following these instructions if you're using Apache.