Only keep the last path element when naming files uploaded via the URL

paste method
This commit is contained in:
Nate Coraor
2017-02-27 10:59:21 -05:00
parent c8dd5f9b25
commit f645259dd0
+1
View File
@@ -95,6 +95,7 @@ def add_file( dataset, registry, json_file, output_path ):
file_err( 'Unable to fetch %s\n%s' % ( dataset.path, str( e ) ), dataset, json_file )
return
dataset.path = temp_name
dataset.name = os.path.basename( dataset.name )
# See if we have an empty file
if not os.path.exists( dataset.path ):
file_err( 'Uploaded temporary file (%s) does not exist.' % dataset.path, dataset, json_file )