- Timestamp:
- 30 Apr 2014, 11:49:18 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r11558 r11608 56 56 grok.templatedir('browser_templates') 57 57 58 ALLOWED_FILE_EXTENSIONS = ('jpg', 'png', 'pdf', 'tif' )58 ALLOWED_FILE_EXTENSIONS = ('jpg', 'png', 'pdf', 'tif', 'fp') 59 59 60 60 class StudentManageSidebar(grok.ViewletManager): … … 828 828 return False 829 829 upload.seek(0) # file pointer moved when determining size 830 file_format = get_fileformat(None, upload.read(512)) 831 upload.seek(0) # same here 830 dummy,ext = os.path.splitext(upload.filename) 831 # fp files are expected to be fingerprint scans, file 832 # format is not yet checked 833 if ext == '.fp': 834 file_format = 'fp' 835 else: 836 file_format = get_fileformat(None, upload.read(512)) 837 upload.seek(0) # same here 832 838 if file_format is None: 833 839 view.flash(_('Could not determine file type.'), type="danger") … … 1010 1016 if ext == '.jpg': 1011 1017 self.response.setHeader('Content-Type', 'image/jpeg') 1018 elif ext == '.fp': 1019 self.response.setHeader('Content-Type', 'application/binary') 1012 1020 elif ext == '.png': 1013 1021 self.response.setHeader('Content-Type', 'image/png')
Note: See TracChangeset for help on using the changeset viewer.