如何计算用户的下载大小?
是否可以计算用户下载的大小? 例如,我有一个大小为10MB的音乐,并且下载链接是可恢复的。 如果我的用户获得了 50%,我可以知道他的下载大小吗?
最好用PHP来完成。
Is this possible to calculate size of downloads from users?
for example, I have a music with size 10MB and the download link is resume-able.
If my user get 50%, can I know that the size of his download?
Its better to be done with PHP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要了解实际下载的大小,您需要命名提供下载的方法/过程。该过程可以知道。
例如,如果您通过服务器提供文件,则通常可以配置服务器日志来存储该信息。然后,您可以解析日志文件以获得下载大小。
不管你喜欢做什么,我不能说用 PHP 来做更好,但如果它更适合你,那就用 PHP 来做。
To know the size of the actual download, you need to name the method/process which delivers the downloads. That process could know.
For example, if you serve the files via your server, you can normally configure the server logs to store that information. You can then parse log-files to obtain the download size(s).
However you like to do it, I can not say it's better to be done with PHP, but if it's better for you, then do it with PHP.