如何知道什么时候下载完成 [英] how to know when download is finished

查看:119
本文介绍了如何知道什么时候下载完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我创建的网上商店。在此肖普人上网必须购买文件,ZIP的扩展名。他们支付他们的信用卡或其他方式获取密钥并下载产品。我怎么能知道,当他们完成产品下载?
谢谢

Hi I'm creating online shop. In this shope people online must be buy files with zip extension. They pay with their credit cards or other methods get key and download product. How can I know when they finish product download? Thanks

推荐答案

可惜的是没有做到这一点没有真正的好办法因为有些客户可能无法下载文件一次(例如Downloadmanagers拆分下载成几个parralel部分下载)。

Unfortunatelly there is no really good way to do this as some clients might not download the file at once (e.g. Downloadmanagers split the download into several parralel part downloads).

选项是:


  • 如果这对你非常重要的,它只能下载一次:你可以
    根本不支持恢复。然后你
    可以登录,如果该文件已被完全
    下载(只要最后一个字节
    已发送)。如果下载的是小这可能会工作得很好。

  • 否则你可以提供一些优雅
    数据(我们通常允许下载
    客户端下载的5倍的大小
    真正下载),并记录每个
    下载尝试。

您不应该仅仅指望下载(因为下载可能会中断)字节。而且不只是确定是否所有章节已被下载一次(也是因为下载可能会被打乱)

You should NOT just count the bytes downloaded (because the download might be disrupted). And NOT just determine if all sections have been downloaded once (also because the download might be disrupted)

我只想澄清:这一切都意味着你必须写自己的下载处理程序(文件服务器)

Just to clarify: All this means that you have to write your own download handler (fileserver).

这篇关于如何知道什么时候下载完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆