It's not necessarily that easy. There isn't a secure 'solution' to your original post.
Firstly, a person can easily get a new IP address if they are on Dial-up. If the user has DSL / Broadband their IP address won't refresh as quickly but it can after a day or so of inactivity.
Secondly, assuming that the user new the server path to the file that they wanted (presumably, from a previous download) all the user has to do is point the browser directly to the file.
While the above would work, it wouldn't stop anyone that 'really' wanted the file. It's like a padlock, it only keeps honest people honest.
Bottom line, if the file is on the net someone will find a way to get it somehow.
Your only secure solution is to develope the code in a way that your server path is NEVER parsed to the browser or stored in browser cache.