You are not logged in.
Hi,
We tried to upload files with the api rest, but we've always got this error message: "["ERROR_UPLOAD_FILE_TOO_BIG_POST_MAX_SIZE","The file seems too big"]".
We are able to create ticket, but can't add files to it.
Here the code, if you can help us :
$ch = curl_init();
$fileName = json_encode($_FILES["filename"]["name"]);
curl_setopt($ch, CURLOPT_URL, $api_url . '/Document/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$post = array(
'uploadManifest' => '{"input": {"name": "Upload","_filename": ["' . $fileName . '"]}};type=application/json',
'filename[0]' => '@' .realpath(basename($_FILES["filename"]["name"]))
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$headers = array();
$headers[] = 'Content-Type: multipart/form-data';
$headers[] = 'Session-Token: '.$sess_token;
$headers[] = 'App-Token: '.$app_token;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
If you had any ideas, please share it
Thanks in advance
Offline
I'm sure you check this already.
just in case
ht t p s://www.tecmint.com/increase-file-upload-size-in-php/
Offline
You do well to ask , but yes, we've put all these at 128MB, to be sure
Offline
moved to API rest section.
see following links it can hel., error is probably not caused by oversized file.
https://forum.glpi-project.org/viewtopic.php?id=176544
https://forum.glpi-project.org/viewtopic.php?id=209103
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline