Follow the below instruction and modify your code with my code <!DOCTYPE html> <html> <head> <title>Click, download file and redirect…