dever 4 years ago
parent
commit
8e6d2eb049
1 changed files with 2 additions and 2 deletions
  1. 2 2
      demeter/admin/page/upload.py

+ 2 - 2
demeter/admin/page/upload.py

@@ -20,10 +20,10 @@ class upload_path(Load):
 		day = day.split('-')
 		for meta in file_metas:
 			name = meta['filename']
-			print(name)
+			temp = name.split('.')
 			file_name =  str(uuid.uuid5(uuid.uuid1(), 'file'))
 			file_path = day[0] + '/' + day[1] + '/' + day[2]
-			file_path = File.mkdirs(os.path.join(Demeter.path, 'runtime','upload', file_path)) + '/' + Demeter.md5(file_name) + '.jpg'
+			file_path = File.mkdirs(os.path.join(Demeter.path, 'runtime','upload', file_path)) + '/' + Demeter.md5(file_name) + '.' + temp[1]
 			with open(file_path, 'wb') as up:
 				up.write(meta['body'])
 		self.out('yes', {'src':url + file_path.replace(Demeter.path + 'runtime', '')})