File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 21
21
st .title ("MultiQC Streamlit App" )
22
22
input_method = st .radio (
23
23
"Choose input method" ,
24
- ("Load from URL" , "Upload File" )
24
+ ("Load from URL" , "Upload File" , "Server Path" )
25
25
)
26
26
27
27
if input_method == "Load from URL" :
40
40
if uploaded_file is not None :
41
41
st .session_state .bytes_data = uploaded_file .getvalue ()
42
42
data_url = uploaded_file .name
43
+
44
+ elif input_method == "Server Path" :
45
+ st .write ("Enter the full path to a MultiQC data ZIP file on the server." )
46
+ server_path = st .text_input ("Server Path" )
47
+ if st .button ("Load from Server Path" ):
48
+ try :
49
+ with open (server_path , 'rb' ) as f :
50
+ st .session_state .bytes_data = f .read ()
51
+ data_url = server_path .split ('/' )[- 1 ] # Get filename from path
52
+ except FileNotFoundError :
53
+ st .error (f"File not found at path: { server_path } " )
54
+ st .session_state .bytes_data = None
55
+ except Exception as e :
56
+ st .error (f"Error reading file from server path: { e } " )
57
+ st .session_state .bytes_data = None
43
58
44
59
# Set EXAMPLE_CUSTOM_DATA in an input - Keep in sidebar for editing anytime
45
60
EXAMPLE_CUSTOM_DATA = st .text_area (
You can’t perform that action at this time.
0 commit comments