Complete the code to import the function used to send files in Flask.
from flask import Flask, [1]
The send_file function is used to send files as responses in Flask.
Complete the code to send a file named 'report.pdf' from the 'files' folder.
return send_file('files/[1]')
The file to send is 'report.pdf' located inside the 'files' folder.
Fix the error in the code to set the file download name to 'summary.txt'.
return send_file('files/summary.txt', as_attachment=[1], download_name='summary.txt')
The as_attachment parameter expects a boolean value True without quotes.
Fill both blanks to send a CSV file named 'data.csv' with the correct MIME type and force download.
return send_file('files/data.csv', mimetype=[1], as_attachment=[2])
The MIME type for CSV files is 'text/csv' and as_attachment=True forces the file to download.
Fill all three blanks to send an image file 'photo.jpg' with correct MIME type, force download, and custom download name 'vacation.jpg'.
return send_file('files/photo.jpg', mimetype=[1], as_attachment=[2], download_name=[3])
The MIME type for JPEG images is 'image/jpeg'. Setting as_attachment=True forces download, and download_name='vacation.jpg' sets the file name for the user.