摘要
采用HFS(Http File Server)的简单文件共享,因使用B/S架构、部署简便获得了广泛应用,缺点是使用HFS内置的自动索引功能时需手动编辑配置文件,开启默认为关闭状态的文件索引功能,造成了安全隐患。基于此,介绍了一种开启HFS自动索引功能实现HFS简单文件共享的替代方法,无需修改HFS配置文件,利用Ruby程序在指定目录及其所有下属子目录生成index.html文件。页面中加入CSS式样,在火狐类浏览器中能明显区分链接是目录还是文件。此外,讨论了当检测到指定目录内容发生变化时,重新生成index.html文件的一种自动化方法。
The simple file sharing using HFS(Http File Server)has been widely used because of its B/S architecture and simple deployment.The disadvantage is that when using the built-in automatic indexing function of HFS,it is necessary to edit the configuration file manually and turn on the file indexing function in the closed state by default,which results in potential security hazards.Based on this,this paper introduces an alternative method to realize HFS simple file sharing by opening HFS automatic indexing function.Without modifying HFS configuration file,the index.HTML file is generated in the specified directory and all its subdirectories by Ruby program.Adding CSS style to the page can clearly distinguish whether the link is a directory or a file in Firefox browser.In addition,an automated method of rebuilding index.HTML files when changes in the contents of specified directories are detected is discussed.
作者
刘以争
Liu Yizheng;China Petroleum University(China Petroleum University(East China,Dongying Shandong 257061,China)
出处
《信息与电脑》
2019年第11期75-76,共2页
Information & Computer