For me, the correct interpretation is at the following link.
Why? Because URL's are "Uniform Resource Locators". They identify a way of finding something, and you can find that resource at a location.
Conversely, On serves no purpose (in this context). If I had a specific server in mind, where I knew a file was, I might say to you "Frodo, you can find that file on Server2". It's on that server.
But links aren't servers, they are directions and so you can find it at that arbitrary-location, irrespective of the real location.
In the second example, the use of "by" could indicate physical proximity to a hat, whereas "with" suggests the man has the hat. In cases where there is a possible physical interpretation, it is better to use "with" (assuming you do not intend to convey that the subject is near an object). In cases where there isn't a possible physical meaning to confuse, "by" works to identify something. "By" as an indication of identity is particularly clear when you specify cases such as example one, where existence of a name is referred to. This fits into implicit phrases like "goes by" or "known by" as suggested in the comments.
Best Answer
The information is within the contents of the file, not placed on top of the file. Therefore, I side with using "in".
By contrast, using "on" feels like there is more to the sentence, like the information about the file... something. For example: