|
|
@@ -422,7 +422,7 @@ class MediaView(MediaPath): |
|
|
|
def mediapath(self,name): |
|
|
|
return self.get_mediapath(self.media_table, self.linked_id, name) |
|
|
|
|
|
|
|
@view_config(request_method='GET') #, http_cache = (EXPIRATION_TIME, {'public':True})) |
|
|
|
@view_config(request_method='GET', http_cache = (EXPIRATION_TIME, {'public':True})) |
|
|
|
def get(self): |
|
|
|
name = self.request.matchdict.get('name') |
|
|
|
try: |
|
|
@@ -431,10 +431,9 @@ class MediaView(MediaPath): |
|
|
|
self.request.response.content_type = test |
|
|
|
except IOError: |
|
|
|
pass |
|
|
|
#try: |
|
|
|
if 1: |
|
|
|
try: |
|
|
|
self.request.response.body_file = open( self.mediapath(name), 'rb', 10000) |
|
|
|
#except IOError: |
|
|
|
# raise NotFound |
|
|
|
except IOError: |
|
|
|
raise NotFound |
|
|
|
return self.request.response |
|
|
|
##return Response(app_iter=ImgHandle, content_type = 'image/png') |