def download(request, filename=None):
"""
Replaces new_download.
This now takes http://<servername>/downloads/<filename>?UUID=<uuid>
This fakes the browser into displaying the filename as the title of the
download.
"""
# Is this from an archive? If so, get the Page ID.
d_uuid=request.GET.get("UUID", None)
if d_uuid == None:
d_uuid=request.GET.get("uuid", None)
if d_uuid in ["", None]:
raise Http404
page = request.GET.get('page', None)
if page is None:
download = index_data.objects.filter(uuid=d_uuid,
ignore=False,
delete_pending=False)[0]
else:
print ("Attempting to find page %s in archive" % page)
print("\tDownloading - %s, %s" % (download.fqpndirectory.lower(),
movie = download.filetype.is_movie
return respond_as_inline(request,
"%s%s%s" % (
configdata["locations"]["albums_path"],
os.sep,
download.fqpndirectory),
ranged=movie)