parameters: ()
return_statement: return jsonify(res)
docstring: 图片上传处理
docstring_summary: 图片上传处理
docstring_tokens: 图片上传处理
function: def upload():
      """图片上传处理"""
      file=request.files.get('editormd-image-file')
      if not file:
          res={
              'success':0,
              'message':'图片格式异常'
          }
      else:
          ex=os.path.splitext(file.filename)[1]
          filename=datetime.now().strftime('%Y%m%d%H%M%S')+ex
          file.save(os.path.join(current_app.config['IMAGES_FOLDER'],filename))
          #返回
          res={
              'success':1,
              'message':u'图片上传成功',
              'url':url_for('.static',filename='pictures/{}'.format(filename))
          }
      return jsonify(res)
function_tokens: def upload ( ) : file = request . files . get ( 'editormd-image-file' ) if not file : res = { 'success' : 0 , 'message' : '图片格式异常' } else : ex = os . path . splitext ( file . filename ) [ 1 ] filename = datetime . now ( ) . strftime ( '%Y%m%d%H%M%S' ) + ex file . save ( os . path . join ( current_app . config [ 'IMAGES_FOLDER' ] , filename ) ) #返回 res = { 'success' : 1 , 'message' : u'图片上传成功', 'url' : url_for ( '.static' , filename = 'pictures/{}' . format ( filename ) ) } return jsonify ( res )