PHP file uploads being “hijacked” by partial uploads

后端 未结 3 1357
悲哀的现实
悲哀的现实 2021-01-03 00:03

I have a site that is receiving 30-40k photo uploads a day and I\'ve been seeing an issue pop up with more frequency now. This issue is this:

Our upload script recei

相关标签:
3条回答
  • 2021-01-03 00:32

    PHP's built-in file handling does not support partial uploads.

    Turn off KeepAlives and/or send a 'Connection: close' header after each upload.

    Configure your webserver to send the header 'Allow-Ranges: none'.

    0 讨论(0)
  • 2021-01-03 00:39

    First off, check you PHP version.

    Second, check your file upload limits and POST_MAX_SIZE in php.ini

    It might just be that someone tries to upload a file that's too large :-)

    0 讨论(0)
  • 2021-01-03 00:39

    Can you try different names for the temp file to avoid its being overwritten? Can you identify the origin of the new, incorrect and incomplete file?

    Is this a development environment? Is it possible that more than one user is uploading files at the same time?

    Try your program with very small images to check if SchizoDuckie is correct about filesize problems.

    Try with different navigators to eliminate the admittedly remote possibility that it is a local problem.

    Check permissions on the directory where the temp file is stored.

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