@app.route('/start', methods=['POST', 'GET'])
def upload_file():
    if (request.method == 'POST'):
        if ('file' not in request.files):
            ret = {'error': 'No selected file'}
            return (ret, 415)
        file = request.files['file']
        if (file.filename == ''):
            ret = {'error': 'No selected file'}
            return (ret, 415)
        if (file and allowed_file(file.filename)):
            filename = secure_filename(file.filename)
            if (filename in os.listdir(app.config['UPLOAD_FOLDER'])):
                filename = ((str(uuid.uuid4()) + '.') + filename.rsplit('.', 1)[(- 1)])
            file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
            ret = {'message': 'file uploaded successfully', 'filename': filename}
            return (ret, 200)
    return '\n    <!doctype html>\n    <title>Upload new File</title>\n    <h1>Upload new File</h1>\n    <form method=post enctype=multipart/form-data>\n        <input type=file name=file>\n        <input type=submit value=Upload>\n    </form>\n    '
@app.route('/start', methods=['POST', 'GET'])
def upload_file():
    if (request.method == 'POST'):
        if ('file' not in request.files):
            ret = {'error': 'No selected file'}
            return (ret, 415)
        file = request.files['file']
        if (file.filename == ):
            ret = {'error': 'No selected file'}
            return (ret, 415)
        if (file and allowed_file(file.filename)):
            filename = secure_filename(file.filename)
            if (filename in os.listdir(app.config['UPLOAD_FOLDER'])):
                filename = ((str(uuid.uuid4()) + '.') + filename.rsplit('.', 1)[(- 1)])
            file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
            ret = {'message': 'file uploaded successfully', 'filename': filename}
            return (ret, 200)
    return '\n    <!doctype html>\n    <title>Upload new File</title>\n    <h1>Upload new File</h1>\n    <form method=post enctype=multipart/form-data>\n        <input type=file name=file>\n        <input type=submit value=Upload>\n    </form>\n    '