Most often we have to post a link for a specific software in our answer. Mostly in questions like how to root your device. Today I was trying to write an answer for How to root Xperia P device I am stuck where I need to post a link for flashtool. The link from which I downloaded the flashtool was no longer available. However I managed to find an alternate link for that but I am worried what happens if this link expires too. Mostly these software or android firmwares were hosted in file hosting websites and after sometimes it will expires or file will be no longer available to download. What to do in that case? I cant complete my answer for that question because of this. Thankyou
I think most savvy users already know better than to run software that's only available as a download from a file-sharing site such as Mediafire, so TBH I wouldn't include such a link at all. If you have to link to an official ROM, then link to the source on the manufacturer's site or equivalent. If you have to link to some other software, link to the distributor's website, or to the relevant XDA Developers page. That has several advantages.
Users can have some confidence about what software they're downloading, and whether it's been tampered with or contains malware
On a site like XDA Developers, people discuss the software in question, so visitors can find out more information, and whether the software can be relied on, by looking at other people's comments there.
If the distribution method of the software changes, the original page will update their links, so visitors can still get the file without anything on this site having to change.
The idea of avoiding link-only answers isn't only to avoid broken links: that reason's quoted most because it's easier to understand. The other reason is that a link-only answer doesn't tell the user what to expect at the other end. Linking to some random file on Mediafire has just the same problem: I don't know whether I'm getting genuine, working software, or a trojan. Linking to an official source or another reputable site lets me know what to expect, making your answer more useful to everyone.