def upload_video_validation():
    def validation(filePath, mimetype):
        size = os.path.getsize(filePath)
        if size > 50 * 1024 * 1024:
            return False
        return True

    options = {'fieldname': 'myFile', 'validation': validation}
    try:
        response = Video.upload(FlaskAdapter(request), '/public/', options)
    except Exception:
        response = {'error': str(sys.exc_info()[1])}
    return json.dumps(response)
def upload_video():
    try:
        response = Video.upload(FlaskAdapter(request), '/public/')
    except Exception:
        response = {'error': str(sys.exc_info()[1])}
    return json.dumps(response)