If we know the actual path of a static file such as: http://www.xx.com/download/51windows.pdf , and if the server does not set any special restrictions, we can download it effortlessly! When the website provides 51windows.pdf for download, how can we prevent the downloader from getting his actual path? This article will introduce how to use Asp to hide the actual download path of files.
When we manage website files, we can put files with the same extension in the same directory and give them a special name. For example, the directory where the pdf files are placed is the_pdf_file_s, and the following code is saved as down.asp, and its online path is http. ://www.xx.com/down.asp, we can use http://www.xx.com/down.asp?FileName=51windows.pdf to download this file, and the downloader cannot see this file The actual download path! In down.asp, we can also set whether downloading files requires logging in, and determine whether the downloaded source page is an external website, thus preventing files from being linked.
Sample code: