匿名用户点击电子邮件上的链接进行下载..
将他重定向在我的视线上..
def fileview(request):
linktoken = request.GET.get('token')
b = cache.get(linktoken)
if b:
the_file = 'gardentruck.zip'
filename = os.path.basename(the_file)
response = HttpResponse(FileWrapper(open(the_file)), content_type=mimetypes.guess_type(the_file)[0])
response['Content-Length'] = os.path.getsize(the_file)
response['Content-Disposition'] = "attachment; filename=%s" % filename
cache.delete(linktoken)
return response
else:
return HttpResponse("token is expired")
1.只想知道有没有办法知道通过电子邮件点击完成的下载请求是否已经完成..
这样我就可以使它过期的链接
2.链接到期后的时间段