This commit is contained in:
j 2016-01-13 23:18:32 +05:30
commit b33d066322
4 changed files with 7 additions and 2 deletions

View file

@ -180,6 +180,8 @@ class UploadHandler(tornado.web.RequestHandler):
while os.path.exists(import_name):
n += 1
name, extension = filename.rsplit('.', 1)
if extension == 'kepub':
extension = 'epub'
import_name = os.path.join(prefix_imported, '%s [%d].%s' % (name, n, extension))
with open(import_name, 'wb') as fd:
fd.write(upload.body)