Supporting HTTP 100 Continue with PHP

后端 未结 2 750
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-07 12:21

I\'m working on a PHP webapp that accepts large POSTed file uploads from specific clients and would like to accept or reject these uploads (based on various headers and other fa

相关标签:
2条回答
  • 2021-02-07 12:51

    Trying to do this on the HTTP level seems too difficult. It is important as a developer to not get hung up on a specific solution. The problem is you want to do a series of checks before you handle the upload. All you need to do is put a qualifying page before the upload. This qualifying page will only show them the upload form if they pass the series of checks and qualify. That is exactly what you are trying to do only you can do it in code PHP. If it is possible, the HTTP 100 thing will always require lots of additional configuration, thus creating a headache for support later on. If you do it in the code those that come behind you (or yourself in a couple of years) will be able to clearly understand what the app is doing.

    0 讨论(0)
  • 2021-02-07 13:11

    Unfortunately I don't think this is possible. If this is a real requirement, I think it's best to simply look at other languages. I think today heterogeneous environments are more common than when this question was written, so why not create a small service written in some other language that just deals with the upload.

    But yea, the way PHP works is that the script only starts when the entire request is sent by the client.

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