no double import contenttype, thanks Salomon Derossi
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.0 (2012-07-05 22:06:22) dev
|
Version 2.00.0 (2012-07-05 22:09:10) dev
|
||||||
|
|||||||
+1
-2
@@ -329,7 +329,6 @@ class Response(Storage):
|
|||||||
downloads from http://..../download/filename
|
downloads from http://..../download/filename
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import contenttype as c
|
|
||||||
if not request.args:
|
if not request.args:
|
||||||
raise HTTP(404)
|
raise HTTP(404)
|
||||||
name = request.args[-1]
|
name = request.args[-1]
|
||||||
@@ -343,7 +342,7 @@ class Response(Storage):
|
|||||||
(filename, stream) = field.retrieve(name)
|
(filename, stream) = field.retrieve(name)
|
||||||
except IOError:
|
except IOError:
|
||||||
raise HTTP(404)
|
raise HTTP(404)
|
||||||
self.headers['Content-Type'] = c.contenttype(name)
|
self.headers['Content-Type'] = contenttype(name)
|
||||||
if attachment:
|
if attachment:
|
||||||
self.headers['Content-Disposition'] = \
|
self.headers['Content-Disposition'] = \
|
||||||
"attachment; filename=%s" % filename
|
"attachment; filename=%s" % filename
|
||||||
|
|||||||
Reference in New Issue
Block a user