From the course: Advanced Python Projects: Build AI Applications
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Challenge: Create a front-end UI for file upload - Python Tutorial
From the course: Advanced Python Projects: Build AI Applications
Challenge: Create a front-end UI for file upload
(bright music) - [Instructor] Now it's time for a new challenge. Use the knowledge that you've gained in the previous lessons to complete this file that's labeled CH_4a_Challenge.py. I've added comments in the file for you to be able to complete this coding challenge. The objective of this challenge is very similar to the chapter three challenge. In the chapter three challenge, you had uploaded the file using backend, now you will be creating a front end for the user to select and upload a file to the AWS S3 bucket. To complete this challenge, import the necessary libraries, set up FastAPI endpoint URL where the file will be uploaded, create a function to handle the file upload, prepare the file to be sent, and send the post request to the FastAPI server. Once sent, check the response status code to ensure that the file was successfully uploaded. And if successful, display a successful message. If it wasn't successful or if an error occurs, display an error message with the response…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Introduction to API communication with Python3m 51s
-
(Locked)
File uploads and advanced API interactions1m 41s
-
(Locked)
Streamlit app basics and file handling2m 29s
-
(Locked)
Uploading files to API endpoints with Streamlit1m 21s
-
(Locked)
Building a chat interface with Streamlit2m 4s
-
(Locked)
How to run the front end of the chatbot3m 12s
-
(Locked)
Challenge: Create a front-end UI for file upload1m 42s
-
(Locked)
Solution: Create a front-end UI for file upload7m 42s
-
(Locked)
-