def create(uploaded_files=[], uploaded_url=[]):
paths = []
for file in uploaded_files:
if file and allowed_file(file.filename):
filename = secure_filename(file.filename)
# TODO check path before save
path = os.path.join(app.config['UPLOAD_FOLDER'])
if not os.path.exists(path):
os.makedirs(path)
path_filename = os.path.join(path, filename)
file.save(path_filename)
paths.append(path_filename)
inp = Input(paths, urls=uploaded_url)
analysis_id = inp.analyze()
logging.info("Analysis {} : {}".format(analysis_id, paths))
return analysis_id
评论列表
文章目录