Changeset 245:d52a1bbfbf30
- Timestamp:
- 18.02.2010 13:04:35 (2 years ago)
- Branch:
- default
- Location:
- djangobb/djangobb_forum
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
djangobb/djangobb_forum/forms.py
r231 r245 107 107 fname = '%d.0' % post.id 108 108 path = os.path.join(dir, fname) 109 file(path, 'w ').write(memfile.read())109 file(path, 'wb').write(memfile.read()) 110 110 obj.path = fname 111 111 obj.save() -
djangobb/djangobb_forum/views.py
r243 r245 784 784 def show_attachment(request, hash): 785 785 attachment = get_object_or_404(Attachment, hash=hash) 786 file_data = file(attachment.get_absolute_path() ).read()786 file_data = file(attachment.get_absolute_path(), 'rb').read() 787 787 response = HttpResponse(file_data, mimetype=attachment.content_type) 788 788 response['Content-Disposition'] = 'attachment; filename=%s' % smart_str(attachment.name)
Note: See TracChangeset
for help on using the changeset viewer.
