A simple component you may use for the secure files downloading. Servlet lets you hide from the visitors
the location for the downloaded file. The usage is:
http://your_host/servlet/SecureDownload?some_key Servlet will find this some_key in the text (properties file) and get the real location
(as well as a name) for the downloaded file. And your configuration file will be provided as an initial parameter
for this servlet. Of course, You can update content of this file at any time. Parameter name is base. Also you can define
an initial parameter a) copy secureDownloadPackage.jar into WEB-INF/lib directory b) describe this servlet in your web.xml file:
<servlet>
c) describe a mapping for this servlet in your web.xml file:
<servlet-mapping> <servlet-name>SecureDownload</servlet-name> <url-pattern>/servlet/SecureDownload</url-pattern> </servlet-mapping> Properties file is a text file, each line describes one file in the form of
Empty lines and any line starts with # or // are ignored. You can use file path as well as URI here.
For example:
key1=c:\myfiles\document.doc key2=http://myhost/mydir/picture.mp3 In this case for example http://your_host/servlet/SecureDownload?key2 will actually download the file from http://myhost/mydir/picture.mp3 Note: the evaluation version supports up to 5 keys in the properties file. For downloading: servlet: secureDownloadPackage.jar
|
Also in Coldtags:
|