Permalink
Browse files

.zip extension issue resolved

  • Loading branch information...
1 parent e02b60b commit 3807f4010a32cd56698d5c988761467fe5da74aa @madhuvishy committed Dec 12, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 badge/views.py
View
@@ -37,8 +37,10 @@ def handle_uploaded_file(cfh, ifh, dirname, rand):
imageData = Image.open(uploadedImage)
handle_uploaded_file(request.FILES['csvfile'], imageData, dirname, str(rand))
filezip = open("outputZIPs/"+dirname+str(rand)+".zip")
- return HttpResponse(filezip, mimetype = "application/x-zip-compressed")
-
+ response = HttpResponse(filezip, mimetype = "application/x-zip-compressed")
+ value = 'attachment; filename=badges_'+str(rand)+'.zip'
+ response['Content-Disposition'] = value
+ return response
else:
error = 'Form invalid'
return errorHandle(error)

0 comments on commit 3807f40

Please sign in to comment.