Tihsrah-CD's picture
test
f756937
raw
history blame
1.6 kB
import streamlit as st
import requests
import os
def main():
st.title('Download File from OneDrive')
download_link = "https://upesstd-my.sharepoint.com/:u:/g/personal/500082340_stu_upes_ac_in/EYwRTq9dcTJHppgydRR-8BMBYY2BehA6jxri5rKehcSZig?e=fjAYDf"
if st.button('Download File'):
response = requests.get(download_link, allow_redirects=True)
if response.status_code == 200:
filename = "downloaded_file.ext" # You can customize the filename
with open(filename, 'wb') as file:
file.write(response.content)
st.success(f"File downloaded successfully and saved as {filename}")
else:
st.error(f"Failed to download the file. Status code: {response.status_code}")
if __name__ == '__main__':
main()
import streamlit as st
import requests
import os
def main():
st.title('Download File from OneDrive')
download_link = "https://upesstd-my.sharepoint.com/:u:/g/personal/500082340_stu_upes_ac_in/EYwRTq9dcTJHppgydRR-8BMBYY2BehA6jxri5rKehcSZig?e=fjAYDf"
if st.button('Download File'):
response = requests.get(download_link, allow_redirects=True)
if response.status_code == 200:
filename = "classifer.joblib" # You can customize the filename
with open(filename, 'wb') as file:
file.write(response.content)
st.success(f"File downloaded successfully and saved as {filename}")
else:
st.error(f"Failed to download the file. Status code: {response.status_code}")
if __name__ == '__main__':
main()