gausoft
gausoft

Reputation: 91

File upload : Controller \"CreateMediaObjectActionController\" does neither exist as service nor as class

I'am trying to use api-platfotm and VichUploaderBundle to upload images but I got an error. Has somebody get this problem before ?

{
  "type": "https://tools.ietf.org/html/rfc2616#section-10",
  "title": "An error occurred",
  "detail": "Controller \"CreateMediaObjectActionController\" does neither exist as service nor as class",
}

Here i'am uploading an image in order to test my confiduration

Upvotes: 1

Views: 550

Answers (1)

Jerzy
Jerzy

Reputation: 61

I had a similar problem. It was caused by missing "use" statement for action class inside entity class where the item operation class was defined.

In you case check if you have use \whatever is your namespace for this\CreateMediaObjectActionController in entity used by media_objects route (src\Entity\MediaObjects ??).

It solved for me an issue with "Controller "XYZ" does neither exist as service nor as class" message but there is no warranty in your case it's exactly the same reason.

Upvotes: 2

Related Questions