image / tools /upload.py
Muthuraja18's picture
Upload 11 files
0f0d66e verified
Raw
History Blame
412 Bytes
import os
UPLOAD_DIR = "uploads"
os.makedirs(UPLOAD_DIR, exist_ok=True)
def save_uploads(files):
"""
Save multiple uploaded files from Streamlit
"""
saved_paths = []
for file in files:
path = os.path.join(UPLOAD_DIR, file.name)
with open(path, "wb") as f:
f.write(file.getbuffer())
saved_paths.append(path)
return saved_paths