简体   繁体   中英

Prevent Direct access to dynamically created file

I have a jsp file that generates some files at runtime, which are also used by swfObject in another page. But i want to prevent the direct access to those files from browser. Since my files are generated at runtime of my jsp s, i don't know how to configure it from .htaccess. All the files that i want to prevent access has .xml extension.

Could you offer a method to me ?

This might be pretty impossible: You want swfObject/Flash to be able to access the files but the browser in which the swfObject/Flash runs should not be able to access the same xml files. For the webserver/.htaccess there is little difference between those two accessing parties.

If swfObject were to access the jsp directly without the generation of temporary files you could work with a "secret" key that is checked in the jsp before the xml is returned. But of course everybody that knows his way around will find this key (firebug for the rescue) and can access your xml therefore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM