Students can attach files to discussion replies in course discussions. This setting is enabled by default and can be managed from the Discussions page or from the Course Settings page. Any attachments added to an ungraded discussion by a student are copied to the student's user files and count against the user quota. However, attachments added to a graded discussion are not counted against the quota.
Note: If a student creates a discussion with an attached file, the file will be added to course files in the unfiled folder.
Edit Discussion Settings
Check the Attach files to discussions checkbox.
Note: Unchecking this option will restrict students from attaching files within Discussions. This permission affects posts in new discussion topics, discussion replies, and discussions within course groups.