question regarding automatically generated html code while displaying files and folders
Is it possible to scan a generated "index of" html site that displays all the files and folders?
For example if I ent开发者_运维知识库er a local web server address in a web browser i get the following generated html site
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /component_test/TEST/ndpgsn_5_0</title>
</head>
<body>
<h1>Index of /component_test/TEST/ndpgsn_5_0</h1>
<ul><li><a href="/component_test/TEST/"> Parent Directory</a></li>
<li><a href="CXS101289_LLVGREY_ATM452_2_06_P16A01_101209134111/"> CXS101289_LLVGREY_ATM452_2_06_P16A01_101209134111/</a></li>
<li><a href="CXS101289_LLVGREY_ATM452_2_06_P16A01_101213085154/"> CXS101289_LLVGREY_ATM452_2_06_P16A01_101213085154/</a></li>
<li><a href="CXS101289_LLVGREY_ATM452_2_06_P16A01_110111180811/"> CXS101289_LLVGREY_ATM452_2_06_P16A01_110111180811/</a></li>
</ul>
</body></html>
can I access this generated html site, so that if I push a link, that a script is automatically runned, is this possible and how would I do it?
If this is not possible, can i make a script that scans the current file level what files that are there and then write them out so that the result will be the above code?
Thanks in advance
Assuming an Apache and that you have access to the server-settings:
You can create a file that will be appended to the generated index-page, see http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html#readmename
Using such a file it should be possible to add a javascript of your own that is doing what you want to(guess you like to request the files via ajax if you click on a link)
精彩评论