Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,10 +22,19 @@ def login(username, password):
|
|
22 |
|
23 |
def upload_files(creators_file, overnight_file, day_file, prime_file):
|
24 |
try:
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
return "Files uploaded successfully!"
|
30 |
except Exception as e:
|
31 |
return f"Error uploading files: {e}"
|
|
|
22 |
|
23 |
def upload_files(creators_file, overnight_file, day_file, prime_file):
|
24 |
try:
|
25 |
+
# Save each file using the 'data' attribute
|
26 |
+
with open(os.path.join(UPLOAD_FOLDER, "creators_file.xlsx"), "wb") as f:
|
27 |
+
f.write(creators_file.read())
|
28 |
+
|
29 |
+
with open(os.path.join(UPLOAD_FOLDER, "overnight_file.xlsx"), "wb") as f:
|
30 |
+
f.write(overnight_file.read())
|
31 |
+
|
32 |
+
with open(os.path.join(UPLOAD_FOLDER, "day_file.xlsx"), "wb") as f:
|
33 |
+
f.write(day_file.read())
|
34 |
+
|
35 |
+
with open(os.path.join(UPLOAD_FOLDER, "prime_file.xlsx"), "wb") as f:
|
36 |
+
f.write(prime_file.read())
|
37 |
+
|
38 |
return "Files uploaded successfully!"
|
39 |
except Exception as e:
|
40 |
return f"Error uploading files: {e}"
|