Spaces:
Sleeping
Sleeping
File size: 933 Bytes
9eec85a 1159291 9eec85a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | import streamlit as st
import os
st.set_page_config(initial_sidebar_state="collapsed", page_title='File Upload')
fname = st.query_params["name"]
#Hide header style
hide_st_style = """
<style>
#MainMenu {visibility: hidden;},
footer {visibility: hidden;},
header {visibility: hidden;}
[data-testid="collapsedControl"] {
display: none
}
[data-testid="stHeader"] {
display: none
}
.st-emotion-cache-1y4p8pa {
width: 100%;
padding: 1rem 1rem 10rem;
max-width: 46rem;
}
[data-testid="stButton"]{
margin-top: 5px;
}
}
</style>
"""
st.markdown(hide_st_style, unsafe_allow_html = True)
st.header("File Information")
st.write(fname)
with open(os.path.join(os.getcwd(),"files",fname), 'rb') as f:
st.download_button('Download', f, file_name=fname)
if(st.button('Delete')):
os.remove(os.path.join(os.getcwd(),"files",fname))
st.info("All files deleted!!! Refresh the page to see changes.")
|