Error while uploading css files to shared entity. | Community
Skip to main content
Level 2
October 22, 2015
Solved

Error while uploading css files to shared entity.

  • October 22, 2015
  • 1 reply
  • 1633 views

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.

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by mikecyang

Hi,

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

$sharedContentObj->getMetadata()->printCurlData();

// request for the sharedContent manifest

$sharedContentObj->getManifest()->printCurlData();


The above fix will be available in the upcoming release.

- Mike

1 reply

mikecyang
Adobe Employee
mikecyangAdobe EmployeeAccepted solution
Adobe Employee
October 22, 2015

Hi,

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

$sharedContentObj->getMetadata()->printCurlData();

// request for the sharedContent manifest

$sharedContentObj->getManifest()->printCurlData();


The above fix will be available in the upcoming release.

- Mike