diff --git a/src/Api/ScoreControllerProvider.php b/src/Api/ScoreControllerProvider.php index e9b6d2c..4983522 100644 --- a/src/Api/ScoreControllerProvider.php +++ b/src/Api/ScoreControllerProvider.php @@ -160,12 +160,12 @@ class ScoreControllerProvider implements ControllerProviderInterface } } - foreach($request->files->all() as $file) { + foreach($request->files->all() as $id => $file) { /* @var $file \Symfony\Component\HttpFoundation\File\UploadedFile */ $filename = $file->getClientOriginalName(); $ext = $file->getClientOriginalExtension(); if($ext != 'jpg' || $file->getMimeType() != 'image/jpeg') { - return new JsonResponse(['success' => false, 'message' => "Image not image/jpeg but " . $file->getMimeType() . " (".$ext.")"], 400); + return new JsonResponse(['success' => false, 'message' => "Image not image/jpeg but " . $file->getMimeType() . " (".$ext.")" ], 400); } @@ -175,7 +175,7 @@ class ScoreControllerProvider implements ControllerProviderInterface list($hit_id, $part) = \explode('-', $id_string); if(!in_array($part, $valid_parts)) { - return new JsonResponse(['success' => false, 'message' => "unknown face part."], 400); + return new JsonResponse(['success' => false, 'message' => "unknown face part '$part'"], 400); } /* @var $hit Models\Hit */