I have a special web page for members.
I am publishing with IIS 10 on Windows server 2016.
Through the website, members upload their private documents to the site.
For example:
http://mywebpage.com/upload/xuser/a.jpg
http://mywebpage.com/upload/xuser/b.pdf
http://mywebpage.com/upload/yuser/c.pdf
http://mywebpage.com/upload/yuser/abc/d.pdf
I use these files in html tags with classic asp. For example;
<a href='http://mywebpage.com/upload/yuser/c.pdf'>yuser transcript</a>
<h1>Profile</h1><img src='http://mywebpage.com/upload/xuser/a.jpg'/>
But I want these files to be accessible only by *.asp files under "http://mywebpage.com".
The possibility that users can access it by typing the link directly into the address bar annoys me very much.
For this, I used the following ways. But I still don't feel safe.
Disallow all files in /upload/ directory with robots.txt.
Prevent browsing to /upload/ with web.config.
Using a complex directory name and complex filenames with the user id and not the yuser. /upload/ASDASD12djd829D2/DUJA811220.jpg
But these are still not the solution I want. Is it possible to say that no one can read these static files except just http://mywebpage.com/*.asp pages? What path should I follow?