File size: 576 Bytes
a39127f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st

st.title("Carga de Archivo PKL")

uploaded_file = st.file_uploader("Choose a file")

if uploaded_file is not None:
    bytes_data = uploaded_file.getvalue()
    string_data = bytes_data.decode("utf-8")
    st.write("File content as bytes:", bytes_data)
    st.write("File content as string:", string_data)
    st.text_area("File content", string_data, height=300)
    with open(uploaded_file.name, "wb") as f:
        f.write(bytes_data)
    st.success(f"Archivo {uploaded_file.name} leido exitosamente.")

st.write("Upload a file to see its content")