Laravel file upload API using Postman

后端 未结 1 1045
粉色の甜心
粉色の甜心 2021-01-02 06:31

I have the following code in my controller:

    public function upload(Request $request)
    {
       $files = $request->file(\'uploads\');
       if(!em         


        
相关标签:
1条回答
  • 2021-01-02 07:19

    The issue was that I was explicitly specifying the Content-Type in postman.

    According to one of the answers from this post:

    There is no need to add a content-type header manually. You are overriding the value set by Postman. Just select form-data in POST request and send your request to see if it works.

    0 讨论(0)
提交回复
热议问题