2012-06-12 53 views

回答

0
$file = WWW_ROOT . 'img' . DS . 'uploads' . DS . 'file123.jpg'; 
+0

你能解释一下吗? –

0

喜欢的应用程序/ Web根目录/ IMG /上传/ file123.jpg我的图片路径

WWW_ROOT定义你的根目录文件夹路径和DS定义 '/'

$image='file123.jpg'; 
$file = WWW_ROOT . 'img' . DS . 'uploads' . DS . $image; 

如果文件检查的条件

if(file_exists($file) && $image){ 
enter your code if file exists 
}else{ 
file not exists 
}