PHP temp file names for uploads colliding

后端 未结 5 2012
离开以前
离开以前 2020-12-16 19:05

When a user uploads a file, randomly it gets replaced by another user\'s upload, I\'ve finally tracked down the issue to PHP and the tmp file name being reused. Is there a w

5条回答
  •  [愿得一人]
    2020-12-16 19:36

    Is PHP running under apache, as mod_php?

    You may try to create a per-process temporary upload directory whose name contains your php getmypid(), then ini_set your PHP process' upload_tmp_dir to that directory. This will not work if a new php process is spawned for every request.

提交回复
热议问题