server.py 文件源码

python
阅读 15 收藏 0 点赞 0 评论 0

项目:SecureSnaps 作者: NITDgpOS 项目源码 文件源码
def encrypt():
    if request.method == 'POST':
        # check if the post request has the file part

        if 'up_pic' not in request.files:
            return "No file selected"
            return redirect(request.url)
        file = request.files['up_pic']
        degree = int(request.form.get('degree'))
        pwd = request.form.get('pwd')

        # if user does not select file, browser also
        # submit a empty part without filename
        if file.filename == '':
            return "No file selected"
            return redirect(request.url)
        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
        links = [str(os.path.join(app.config['UPLOAD_FOLDER'], filename))]
        if request.form['submit']=="enc":
            (im,arr,path)=enc.encode(links[0],degree,pwd)
        else:
            (im,arr,path)=dec.decode(links[0],degree,pwd)
        links.append(path)
        return render_template("display.html",link=links)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号