//文件浏览程序
error_reporting(0);
$pwd = empty($_GET['dir']) ? './' : $_GET['dir'];
$pwd = realpath($pwd);
if(is_file($pwd)) {
highlight_file ($pwd);
exit;
}else
$it = new FilesystemIterator($pwd);
?>
pwd of
pwd of
">../
foreach ($it as $file){
if($file->isDir()) {
$fileSize = '_';
$fileName = $file->getFilename() . '/';
} elseif($file->isFile()) {
$fileSize = $file->getSize();
$fileName = $file->getFilename();
}
$date = date('Y-m-d H:i',$file->getCTime());
?>getRealPath()?>">
2. 运行效果如下图所示:
希望本文所述对大家的php程序设计有所帮助。
...th){
if($this->getRealPath($url_path)){
if(is_readable($this->getRealPath($url_path))){
return
...
DOCUMENT_ROOT 与http://host/对应的路径。 getServletContext().getRealPath("/")
注意低版本Servlet规范中的等价表达方式是request.getRealPath("/")。
HTTP_XXX_YYY 访问任意HTT
...nds SplFileInfo{
public function __destruct(){
var_dump($this->getRealPath());
}
}
$file = new FileTest('index.php'); //boolean fa
...>
}
$date = date('Y-m-d H:i',$file->getCTime());
?>getRealPath()?>">
...
... {
@ rmdir( $file->getRealPath() );
}else{
@ unlink( $file->getRealPath() );
}
}
...hrows ServletException, IOException {
String path=this.getServletContext().getRealPath("/WEB-INF/classes/mess.properties");
//项目里src的文件都在
...().getParameter("imgname");String absPath = this.getServletContext().getRealPath("/images");//获取文件的保存路径System.out.println(absPath);Stri
...的上下文路径。
name = session.getServletContext().getRealPath("") + "\\" + realName + ".html";
...eName);template.setEncoding("UTF-8");File htmlFilel = new File(context.getRealPath("") +File.separator +"html"+File.separator+"channel");if(!
...rator($path); foreach ($files as $file) { $fileRealPath = $file->getRealPath(); //文件绝对路径 $compressCssFileRealPath = str_replace(".