File size: 924 Bytes
ca8935b
7d7cace
ca8935b
 
55a439e
a3794b3
c892be7
 
 
 
 
 
 
 
 
 
 
 
a3794b3
 
a84592b
a3794b3
a84592b
a3794b3
 
ccb54a0
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
import os

x = st.slider('Select a value')
st.write(x, 'squared is', x * x)


path = './tempDir'

# Check if the directory already exists
if not os.path.exists(path):
    os.mkdir(path)
    st.write(f"Directory '{path}' created")
else:
    st.write(f"Directory '{path}' already exists")



uploaded_file = st.file_uploader("Upload File")
if uploaded_file is not None:
    file_details = {"FileName":uploaded_file.name,"FileType":uploaded_file.type}
    st.write(file_details)
    with open(os.path.join("tempDir",uploaded_file.name),"wb") as f: 
      f.write(uploaded_file.getbuffer())         
    st.success("Saved File")


# Specify the directory path
directory_path = 'path/to/directory'

# List all files in directory and subdirectories
files = []
for root, dirs, file_names in os.walk(path):
    for file_name in file_names:
        files.append(os.path.join(root, file_name))

st.write(files)