12 lines
494 B
Python
12 lines
494 B
Python
|
import os
|
||
|
from django.conf import settings
|
||
|
from django.http import HttpResponse, Http404
|
||
|
|
||
|
def download(request):
|
||
|
file_path = os.path.join(settings.MEDIA_ROOT, 'pom.apk')
|
||
|
if os.path.exists(file_path):
|
||
|
with open(file_path, 'rb') as fh:
|
||
|
response = HttpResponse(fh.read(), content_type="application/vnd.android.package-archive")
|
||
|
response['Content-Disposition'] = 'inline; filename=' + os.path.basename(file_path)
|
||
|
return response
|
||
|
raise Http404
|