I faced the same problem today when I was uploading couple of files.
Four files were uploaded just fine but fifth file failed with the same error.
After debugging it, I noticed that the file name is not retrieved correctly in administrator/components/com_media/src/Controller/ApiController.php function postFiles.
Output of the line
$name = $content->getString('name');
is empty even when the raw contents of the json show that the filename is present in the json:
{"07ee3357912d99857ba2f76efae0354b":"1","name":"file5.jpg","content":"/9j/4AAQSkZJRgABAgAAAQABAAD/
On succeeding file the last chars of the raw json are =="} but on failing file the json is not correctly terminated.
I tried this two browsers with same results.
Joomla! 4.4.3
PHP 8.1.27
Four files were uploaded just fine but fifth file failed with the same error.
After debugging it, I noticed that the file name is not retrieved correctly in administrator/components/com_media/src/Controller/ApiController.php function postFiles.
Output of the line
$name = $content->getString('name');
is empty even when the raw contents of the json show that the filename is present in the json:
{"07ee3357912d99857ba2f76efae0354b":"1","name":"file5.jpg","content":"/9j/4AAQSkZJRgABAgAAAQABAAD/
On succeeding file the last chars of the raw json are =="} but on failing file the json is not correctly terminated.
I tried this two browsers with same results.
Joomla! 4.4.3
PHP 8.1.27
Statistics: Posted by jytky — Sat Mar 16, 2024 9:38 am