阅读量:1
}
二、后端代码(python)
import os
from re import template
from string import Template
from flask import Flask, send_file,request,jsonify
from werkzeug.utils import secure_filename
from flask_cors import CORS
import time
app = Flask(name)
absolute = os.path.dirname(file)
CORS(app)
app.debug = True
定义文件的保存路径和文件名尾缀
FOLDER = os.path.join(absolute, ‘save_file’)
HOST = “localhost”
PORT = 8080
UPLOAD = ‘upload’
app.config[‘UPLOAD’] = UPLOAD
basedir = os.path.abspath(os.path.dirname(file))
ALLOWED_EXTENSIONS = set([‘txt’,‘png’,‘xls’,‘xlsx’,‘jpeg’,‘jpg’])
进行文件类型判断的函数
def a