dsfb20227 2012-03-29 15:52 采纳率: 0%
浏览 43

有没有办法检查文件是否使用PHP完全上传?

I have a directory on a remote machine in which my clients are uploading (via different tools and protocols, from WebDav to FTP) files. I also have a PHP script that returns the directory structure. Now, the problem is, if a client uploads a large file, and I make a request during the uploading time, the PHP script will return the file even if it's not completely uploaded. Is there a way to check whether a file is completely uploaded using PHP?

  • 写回答

3条回答 默认 最新

  • dptn69182 2012-03-29 15:56
    关注

    Setup your remote server to move uploaded files to another directory, and only query the directory files are moved to for files.

    AFAIK, there is no way (at least cross-machine) to tell if a file is still being uploaded, without doing something like:

    1. Query the file's length
    2. Wait a few seconds
    3. Query the file's length
    4. If it's the same, its possibly completed
    评论

报告相同问题?