Complete the code to import the function used to send files in Flask.
from flask import Flask, [1]
The send_file function is used in Flask to send files like images to the client.
Complete the code to create a Flask route that serves an image file named 'photo.jpg'.
@app.route('/image') def serve_image(): return [1]('photo.jpg')
Use send_file to send the image file to the browser when the route is accessed.
Fix the error in the code to correctly serve an image with the right MIME type.
return send_file('photo.jpg', mimetype=[1])
The MIME type for JPEG images is image/jpeg. This tells the browser how to handle the file.
Fill both blanks to serve an image file from a folder named 'static/images'.
return send_file('[1]/[2]')
The image is stored in the 'static/images' folder, so the path must include both folder names.
Fill all three blanks to serve an image file named 'logo.png' with the correct MIME type from 'static/assets'.
return send_file('[1]/[2]/logo.png', mimetype=[3])
The image is in 'static/assets' folder and is a PNG file, so the MIME type is image/png.