PUT upload does not fill $_FILES

后端 未结 1 1511
忘了有多久
忘了有多久 2021-01-24 10:35

I\'m using PUT method to upload files using dropzone.js on frontend. However when I want to work with files both Symfony\'s Request object and $_FILES

1条回答
  •  孤城傲影
    2021-01-24 11:15

    PHP does not convert files uploaded via PUT method into $_FILES hence Symfony`s Request object is empty too.

    You need to handle incoming file using following code.

    /* PUT data comes in on the stdin stream */
    $putdata = fopen("php://input", "r");
    

    Or using $request->getContent() in symfony.

    PHP also supports PUT-method file uploads as used by Netscape Composer and W3C's Amaya clients. See the PUT Method Support for more details. http://php.net/manual/en/features.file-upload.post-method.php

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