Meteorama commited on
Commit
9eec85a
·
verified ·
1 Parent(s): 84f071d

Upload 2 files

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