Fix file extension determination

Extension was determined uncorrectly for filenames with more than 1 dot
This commit is contained in:
Nicola Soranzo
2013-03-06 12:37:08 +01:00
parent de3cff9379
commit 2f650b8866
+1 -1
View File
@@ -247,7 +247,7 @@ def add_file( dataset, registry, json_file, output_path ):
#binary_ok = False
parts = dataset.name.split( "." )
if len( parts ) > 1:
ext = parts[1].strip().lower()
ext = parts[-1].strip().lower()
if not Binary.is_ext_unsniffable(ext):
file_err( 'The uploaded binary file contains inappropriate content', dataset, json_file )
return