2016-06-07 3 views
0

우리는 chrome plugin postman을 사용하여 파일을 업로드 할 때 작동하는 파일 업로드 기능을 수행했습니다. 단지 2 I 업로드 우체부에서symfony 3 파일 업로드 Accept.php throws InvalidMediaType

POST /groups/b7eedbcc-2c88-11e6-b44b-84e5c9e767ae/uploaded-files HTTP/1.1 
Host: [our project domain] 
Connection: keep-alive 
Content-Length: 6418 
Pragma: no-cache 
Cache-Control: no-cache 
Accept: undefined 
Origin: http://172.17.2.101:3000 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36 
Authorization: undefined 
Content-Type: application/octet-stream 
Referer: http://172.17.2.101:3000/ 
Accept-Encoding: gzip, deflate 
Accept-Language: en-US,en;q=0.8,lt;q=0.6 

, 내가 사용 :이 같은

enter image description here

전달 헤더 : 우리가 각 2 응용 프로그램과 함께 테스트 할 때

, 우리는 오류 얻을

Authorization: 123 
Content-Type: application/octet-stream 

권한 부여가 위쪽에서 정의되지 않은 이상한 경우 인증이 통과되지 않으면 응답은

{ 
    "message": "Authentication required" 
} 

이므로 아직 문제가되지 않습니다.

이 오류는 무엇을 의미합니까? 어떻게 해결할 수 있습니까?

내가 심포니 컨트롤러에 오지 않았다는 것을 알아 채 셨나요? die();를 사용하려고했습니다.

답변

0

Accept 헤더가 정의되지 않았 음을 알게되었습니다.

symfony 시스템 파일에서 'application/json'에 하드 코드되었으며 권한이없는 다른 오류가 발생했습니다.

또한 하드 코딩 된 인증 키와 파일이 업로드되었습니다.