Commits

Benjamin Klüglein committed 38d0cbd

Added Length header

Comments (0)

Files changed (2)

templates/upload/show_download.html

 <div>
-
-{{ download.download_password }}
-
 <table>
 <tr><td>Datei:</td><td>{{ download.name }}</td></tr>
 <tr><td>Beschreibung:</td><td>{{ download.description }}</td></tr>
 <tr><td>Dateiname:</td><td>{{ download.filename }}</td></tr>
-<tr><td>Passwort notwendig?</td><td>{{ download.is_password_protected }}</td></tr>
+<tr><td>Passwort notwendig?:</td><td>{{ download.is_password_protected }}</td></tr>
 <tr><td>Hinzugefügt:</td><td>{{ download.created_at }}</td></tr>
 </table>
 
             file_to_download = DjangoFile(f.file_on_fs)
             response = HttpResponse(file_to_download, mimetype=guess_type(file_to_download.name)[0])
             response['Content-Disposition'] = 'attachment; filename=%s' % f.filename()
+            response['Content-Length'] = os.path.getsize(file_to_download.name)
             return response
         else:
             return HttpResponseForbidden("Zugriff nicht gestattet. Passwort falsch!")