mirror of
https://github.com/AmanTahiliani/PeerNotes.git
synced 2026-12-05 15:14:41 -05:00
Updated file service
This commit is contained in:
1 parent
94c534963d
commit
38a1bdf604
2 files changed
+3
-2
No files matched your search
@@ -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)
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Hello World!
|
||||||
|
Flask Notes Transfer Test 2
|
||||||
Reference in new issue
Block a user