Error while uploading css files to shared entity.



Checked the functionality for shared content. Created one sharedContent entity and uploaded two js files in that. But facing problem for files with other mimetypes like images, css etc. Its throwing error "Bad mimetype found. Asset declared to be of mimetype application/javascript, but was found to be image/png".

Checked the function uploadSharedContent in file /class/sharedEntity.php and found the following piece of code which is declaring mime type:

$headers = $this->_setHeaders($this->mimetypes['json'], $this->mimetypes['js'], $this->parameters['client_upload_id']);

I have followed the syntaxes in the API documentations and also from the example in the PHP example package /sharedContent/create_shared_entity.php

Can you please let me know if I am missing anything for uploading the css/images to shared entity.


Accepted Solutions (1)

Accepted Solutions (1)





Please update the line that you pointed out (file /class/sharedEntity.php line #70) to as follows:

$headers = $this->_setHeaders($this->mimetypes['json'], null, $this->parameters['client_upload_id']);

Also, in the demo script (file /sharedContent/create_shared_entity.php starting line #49), please make sure that it matches the following:

// request & store the latest content URL


// request for the sharedContent manifest


The above fix will be available in the upcoming release.

- Mike

Answers (0)