Hello,
i would like to add file types to be uploaded using the asset action [omekas]/admin/asset
I saw the phtml file, that i edited to add the MIME i needed, but even though the MIME i want to use (application/pdf) is in the allowed extensions and all of my website, i can’t manage to ge the uploader to accept them.
I understood that the file application/src/Controller/Admin/AssetController.php handles this, but i am unfamiliar with laminas, and i found myself stuck
public function addAction()
{
$httpResponse = $this->getResponse();
$httpResponse->getHeaders()->addHeaderLine('Content-Type', 'application/json');
if ($this->getRequest()->isPost()) {
$postData = $this->params()->fromPost();
$fileData = $this->getRequest()->getFiles()->toArray();
try {
$response = $this->api(null, true)->create('assets', $postData, $fileData);
$httpResponse->setContent(json_encode([]));
....
This is the action that should handle “sending the file”, but i don’t see any way i could tweak it.
Someone already managed to do this ?
Thanks