# How to raise a "File Download" Dialog Box in Python CGI Programming?

PythonServer Side ProgrammingProgrammingCGI

#### Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

#### Practical Machine Learning using Python

Best Seller

91 Lectures 23.5 hours

#### Practical Data Science using Python

22 Lectures 6 hours

Sometimes, it is desired that you want to give option where a user can click a link and it will pop up a "File Download" dialogue box to the user instead of displaying actual content. This is very easy and can be achieved through HTTP header.

For example, if you want make a FileName file downloadable from a given link, then its syntax is as follows −

#!/usr/bin/python
fo.close()