PHP: How do I avoid reading partial files that are pushed to me with FTP?

后端 未结 7 1832
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 19:19

Files are being pushed to my server via FTP. I process them with PHP code in a Drupal module. O/S is Ubuntu and the FTP server is vsftp.

At regular intervals I will

7条回答
  •  礼貌的吻别
    2021-01-01 20:11

    Picking up on the previous answer, you could copy the file over and then compare the sizes of the copied file and the original file at a fixed interval.

    If the sizes match, the upload is done, delete the copy, work with the file.

    If the sizes do not match, copy the file again.

    repeat.

提交回复
热议问题