When using the File item in Moodle, you can control what happens when a student clicks on the link to the file.
Open: open the file in the current window/tab (if possible with this file type)
Force Download: download the file and stay on the existing page in the web browser
Embed: Open the file within the Moodle course page (if possible with this file type)
New Window: open the file in a new window/tab (if possible with this file type)
In pop-up: open the file in pop-up window (if possible with this file type). Many browsers block pop-up windows, so this is not a suggested approach.
Change file behaviors
To change the behavior of the file item, go into Edit Mode and Edit Settings for the file item. Under the Appearance section, change the Display option.
Suggested behavior
While it is often preferable to open files in a New Window, it is not a best practice in order to reach all users. From an accessibility standpoint, a link or file should open in the current tab unless there is a signal to indicate that the file will open in a New Window. Therefore, Open is the preferred option.
Some files, such as Microsoft Word documents, cannot be opened in a web browser and will download no matter which option is selected. Some types of files, especially text-based files such as computer programs, may open in the web browser. For these files, Force Download may be more appropriate.