PHP temp file names for uploads colliding

后端 未结 5 2010
离开以前
离开以前 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:45

    It sounds like something is seriously wrong with either your PHP installation or whichever system call PHP is internally using to generate the random file names (most likely tempnam).

    For everyone else: PHP handles uploaded files internally before the user code is ever processed. These names are stored in $_FILES['file']['tmp_name'] (where 'file' is the (quoted) name of the file input element on the form).

提交回复
热议问题