How to have Firefox save txt files automatically instead of opening in browser

Solution 1:

Simply right-click the link and Save Link as.

OR

Go to about:config page in Firefox, then set browser.altClickSave to true then you can force a download if you hold down the Alt key and left-click the link.