Skip to content

Instantly share code, notes, and snippets.

@level09
Created January 10, 2016 20:31
Show Gist options
  • Save level09/f92d3e27a95af9055b25 to your computer and use it in GitHub Desktop.
Save level09/f92d3e27a95af9055b25 to your computer and use it in GitHub Desktop.
@bp_public.route('/video-upload',methods=['POST'])
@login_required
def video_upload():
file = request.files['file'] if 'file' in request.files else None
if file:
file_name = datetime.strftime(datetime.now(),'%Y%m%d-%H%S') +'-'+ secure_filename(file.filename)
file.save(os.path.join(Config.UPLOAD_DIR,file_name))
return file_name, 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment