From the course: Advanced Python Projects: Build AI Applications

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Challenge: Complete the backend code for file upload

Challenge: Complete the backend code for file upload - Python Tutorial

From the course: Advanced Python Projects: Build AI Applications

Challenge: Complete the backend code for file upload

(upbeat electronic music) - [Person] It's time for a challenge now. Use the knowledge that you've gained in the previous lessons and complete this coding lesson. We'd like for you to use the code that's within the "Begin" folder labeled as "CH_3a_challenge." The libraries needed to complete this challenge have been already populated for you. Go ahead and initialize the FastAPI app. The libraries necessary for you to complete this challenge have already been populated for you. In this challenge, please go ahead and initialize the FastAPI app, set up the AWS A3 session using your own AWS access key ID and secret access key. Install MongoDB in code-space and start the database. Update the S3 bucket and S3 bucket path based on what you've defined in your AWS environment. Once you've done that, go ahead and create the upload endpoint. Next, extract the file name from the uploaded file, and save the file temporarily to a local file system, then get the file size and get the upload…

Contents