Ajax / jQuery查找用户是否完成下载 [英] Ajax /jQuery finding if user completed the download

查看:115
本文介绍了Ajax / jQuery查找用户是否完成下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我要做的:我正在制作一个包含测试的自定义文本文件。此测试是用户唯一的,我不希望我的服务器堆栈所有这些文本文件。

Here is what I am trying to do: I am making a custom text file containing a test. This test is unique to the user and well I don't want my server to stack all those text files.

有没有办法使用Ajax / JavaScript / jQuery查找用户是否已经完成下载,如果他们已经获得了一个返回值(如果已经完成,则为1)该响应可以发送回PHP文件,它可以从服务器上删除该文件(实时类似)?

Is there a way to use Ajax/JavaScript/jQuery to find if the user has already finished the download and if they have get a return value (1 if finished) so the response can be sent back to the PHP file and it can delete that file off the server (real-time like)?

我知道有很多方法可以这使用PHP。类似于在用户注销之后运行清理等等,但是我想尝试使用上述方法,因为它可以有许多其他可能很酷的应用程序。我尝试了大多数搜索引擎,但没有什么接近我需要的。

I know there are plenty of ways to do this using PHP. Sort of like run clean up upon user log out and so on but I wanted to try using the method above since it can have many other applications that might be cool to use. I tried most search engines but they have nothing close to what I need.

推荐答案

为什么需要将它们存储在文件中?只需使用PHP脚本或创建测试并将其直接输出给用户。下载完成后,它将被删除。

Why do you need to store them in a file? Just use a PHP script or such that creates the test and outputs it directly to the user. That's how it will get deleted when the download is complete.

这篇关于Ajax / jQuery查找用户是否完成下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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