Hello ST community,
File Uploader does not work if the Excel file is not in directory, It says FileNotFound error. This should not occur, correct? I even passed in the variable existingWBUploaded into the code line β #Opens the existing Workbook
existing_wb = load_workbook(existingWB) #TODO: changed from existingWB
#creates a new sheet inside the existing workbook
existing_wb.create_sheet(sheetName)
The important thing to understand about st.file_uploader is that it transfers the data through the browser into the Python and stores it in a BytesIO buffer. This is a different workflow that referencing a file directly on your computer.
Streamlit is built this way as you cannot guarantee that the place where the app is running is 1) the same computer where the app was developed and 2) that the computer where the app is running has the same file structure as the computer where the app was developed.
Once you have uploaded the file through file_uploader, you can process it as shown in the Examples section of the docs:
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking βAccept allβ, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.