Posted on 2008-07-10 17:40
追夢(mèng)人 閱讀(171)
評(píng)論(0) 編輯 收藏 所屬分類:
Other
String path = request.getRealPath("");
String[] imgtype = {".jpg",".jpeg",".bmp",".png",".gif"};
for(String type : imgtype)
{
File f=new File(path,"images/"+userinfo.getId()+type);
//檢查是否存在
if(f.exists())
{
f.delete();//刪除文件
break;
}
}