Created
April 1, 2021 10:45
-
-
Save Ratheshprabakar/e051d42dc4e3a6de92c546816ff7b16f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload(): | |
if not os.path.isfile(APP_ROOT+"/image.jpeg"): | |
return render_template("upload.html",msg="spoof detected") | |
id_folder = str(request.form['id_folder']) | |
session['id_folder']= id_folder | |
target = os.path.join(APP_ROOT,"test/") | |
if not os.path.isdir(target): | |
os.mkdir(target) | |
target1 = os.path.join(target,str(request.form["folder_name"])+"/") | |
test_append = str(request.form["folder_name"]) | |
session['test_append']= test_append | |
print(target1) | |
if not os.path.isdir(target1): | |
os.mkdir(target1) | |
shutil.copyfile(APP_ROOT+"/"+"image.jpeg",target1+"image.jpeg") | |
destination = APP_ROOT + "/" + "test/" + test_append + "/" + "image.jpeg" | |
session['destination'] = destination | |
teacher_name = str(session.get('user')) | |
session['teacher_name'] = teacher_name | |
#return render_template("upload.html",msg="uploaded successfully") | |
return match() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment