fix(uploaders): restrict file types on portfolio master and builder pages

Mac Safari was offering folder uploads when type=None was set on
file_uploader. Set explicit type=[htm,html,csv] on both
portfolio master and builder pages so the OS picker restricts to
individual files of supported extensions.
This commit is contained in:
unknown
2026-05-06 16:27:29 +10:00
parent 045365838b
commit fbc63e8a0b
2 changed files with 328 additions and 68 deletions
+4 -1
View File
@@ -546,10 +546,13 @@ def render():
expanded=not bool(st.session_state.pm_files)):
st.caption("Accepts `.htm` · `.html` · `.csv`")
uploaded = st.file_uploader(
"Select files", type=None, accept_multiple_files=True,
"Select files",
type=["htm", "html", "csv"],
accept_multiple_files=True,
key=f"pm_uploader_{st.session_state.pm_uploader_key}",
)
if uploaded:
# Streamlit already filters by type, defensive check anyway
uploaded = [f for f in uploaded
if f.name.lower().endswith((".htm",".html",".csv"))]
for f in uploaded: