I’m not a lawyer, so I’m not an expert and fanfic is already on the edge of legality. So while a fanfic does infringe on the original author’s work, it’s also got its own copyright because it’s considered a derivative work. In the case of Harry Potter, JKR’s made it generally clear that she’s okay with it so long as you’re not making money from it. I mention the derivative work thing because she can’t take your fanfic and publish that without your permission either… In the gaming world, some game studios make that a stipulation in the ToS in order for a mod-author to publish a game mod, ie, the studio can take it and make it an official part of the game.
Saving of stories is a definite grey area, and makes authors uncomfortable because some saved copies have a habit of showing up on other websites, perhaps an older revision, under either their name, or under a new author’s name (see the hall of shame for examples...).