awacke1 commited on
Commit
857469a
·
1 Parent(s): 3370f55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -19,8 +19,11 @@ if uploaded_file is not None:
19
 
20
  # Convert file to base64
21
  b64 = base64.b64encode(file_content).decode()
22
- st.markdown(f"File successfully uploaded. Here is the base64 link:")
23
- st.markdown(f"`{b64}`")
 
 
 
24
 
25
  # Modify app.py
26
  new_code = f"# Modified by {username}\n"
 
19
 
20
  # Convert file to base64
21
  b64 = base64.b64encode(file_content).decode()
22
+ st.markdown(f"File successfully uploaded. Here is the download link:")
23
+
24
+ # Create a download link
25
+ href = f'<a href="data:file/txt;base64,{b64}" download="your_file.txt">Download File</a>'
26
+ st.markdown(href, unsafe_allow_html=True)
27
 
28
  # Modify app.py
29
  new_code = f"# Modified by {username}\n"