Check file type (FLV) before PHP upload file in temporary folder by reading only starting 3 bytes of file

前端 未结 2 947
粉色の甜心
粉色の甜心 2020-12-31 05:21

First 3 bytes of FLV file are signature \"FLV\". Now my question:

Is there any possibility in PHP to handle file uploads so that we can hook into the input stream of

2条回答
  •  梦谈多话
    2020-12-31 06:08

    @burhan-khalid provided a more up to date and correct answer above.

    Short Answer is no with your constraints.

    You can not access that file with PHP until it has been uploaded to the server. After it is uploaded you can read it but not before, at least not without some type of client side software that would allow you to stream it to PHP instead of the normal form submission.

提交回复
热议问题