The posting of copyrighted material is entirely illegal. If there is open access to an article, it's best to post a link rather than the actual article.
My paper was accepted to a peer review journal and the editor told me I am allowed to post the accepted manuscript, with a mention that it was accepted for publication in this journal.