Changeset 9930 for main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
- Timestamp:
- 2 Feb 2013, 16:53:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r9857 r9930 1038 1038 return 1039 1039 target = os.path.join(self.context.storage, normalized_filename) 1040 open(target, 'wb').write(uploadfile.read()) 1040 filecontent = uploadfile.read() 1041 1042 # XXX: temporary solution to prevent users from 1043 # uploading non-ascii files. 1044 for element in filecontent: 1045 try: 1046 if ord(element) > 128: 1047 self.flash(_( 1048 "Only ASCII files are allowed. " 1049 "Your file contains non-ascii characters.")) 1050 return 1051 except TypeError: 1052 self.flash(_( 1053 "Only ASCII files are allowed. " 1054 "Your file contains non-ASCII characters.")) 1055 return 1056 1057 open(target, 'wb').write(filecontent) 1041 1058 os.chmod(target, 0664) 1042 1059 logger = self.context.logger
Note: See TracChangeset for help on using the changeset viewer.