Q. Can one fulfil the mitzvah of writing a Sefer Torah these days by writing a sefer on the internet that is open for all to learn from and to download?
A. The opinion of the Rosh (beginning of Hilchos Sefer Torah, quoted in Tur (Y.D. 270,) Shulchan Aruch (ibid. 2,) is that in our days when it is not common to learn directly from a Sefer Torah, but rather from printed texts of Chumashim, Mishnayot, Talmud and all other sefarim, the main mitzva of writing a Sefer Torah is accomplished when you acquire those seforim. Poskim disagree if today according to the Rosh there is still a mitzvah to write a Sefer Torah.( Perisha, Taz and Shach Y.D. 270: 4 – 5, Piskey Teshuva- ibid. Chayei Adam 31: 50.) Many Poskim maintain that although there is still a mitzva to write a Sefer Torah, priority should be granted to having seforim that we can learn from; After all the Torah itself writes that the reason for writing a Sefer torah is to teach the Bnay Yisroel. (Devarim 31: 19)
The Rosh does not mention that the mitzva is necessarily to author a new sefer; or to write or print one either. Rather you have to acquire them so you can learn from them. Poskim debate whether acquiring seforim that will not be used is a mitzva at all or if when one has already free access to available seforim in a Beth Midrash or library, if there is still a mitzva to obtain one’s own private seforim (Yikra Deuraisa p.21.) Undoubtedly, when authoring seforim that are needed, you comply with the mitzva of Kesivas Sefer Torah according to the Rosh.
Horav Shlomo Miller's Shlit'a opinion is that if you write or make available already published sefarim (without infringing on the author's rights) and post them on the internet where they will be used more readily or will have better and greater access than what is available now, you fulfill this mitzva according to the Poskim that follow the opinion of the Rosh.
Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit”a.