Require users to put in the information before they download

Hi, I am planning to make a website where teaching materials are shared.
People can download the teaching materials at the site, but through a pop-up window, I'd like to require them to put in information such as grades of students they teach, subjects they teach, their email, the countries they teach and the reason they download the materials.
How can I accomplish this function?
Thank you.