mirror of
https://github.com/AmanTahiliani/PeerNotes.git
synced 2026-08-07 19:56:19 -04:00
Updated file service
This commit is contained in:
@@ -45,13 +45,12 @@ def request_file():
|
|||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
if os.path.exists(file_path):
|
if os.path.exists(file_path):
|
||||||
|
|
||||||
return "File with name already exists", 200
|
return "File with name already exists", 200
|
||||||
|
|
||||||
with open(file_path, 'wb') as f:
|
with open(file_path, 'wb') as f:
|
||||||
f.write(response.content)
|
f.write(response.content)
|
||||||
print("File downloaded successfully")
|
print("File downloaded successfully")
|
||||||
return f'File Downloaded to location to location {file_path}',
|
return f'File Downloaded to location to location {file_path}', 200
|
||||||
else:
|
else:
|
||||||
error = response.text
|
error = response.text
|
||||||
print("Error:", error)
|
print("Error:", error)
|
||||||
|
|||||||
2
file_peer/uploads/2_bcdef.txt
Normal file
2
file_peer/uploads/2_bcdef.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Hello World!
|
||||||
|
Flask Notes Transfer Test 2
|
||||||
Reference in New Issue
Block a user