用什么方式实现都行。。
解决方案 »
- 关于鼠标移动事件和图片放大效果的问题
- 请高手回答有关collection迭代问题
- 大家帮我一下,这个怎么实现。
- 在线等-------我的myelcipse只使用了我的256m内存的64m,所以速度一直很忙,怎么提高默认的使用内存?
- out.println方法可以用在bean class 中吗?我用了后一直报错!
- 帮忙下在线等急 出现非法游标状态 马上结分
- 如何获取java.sql.* ???
- Struts2 报错 方法找不到
- <%jsp:include和<%@ include的区别到底是什么?
- 在java类中,如何得到web-inf目录下的文件路径(相对、绝对)
- jfreeChar与struts2整合问题
- 如何在response中带参数
String aa = request.getRealPath("/UserFtp/"+listproduct.get(i));
File MyDir = new File(aa+".");
String filename[] = MyDir.list();
我的意思是类似file控件 选的 html file 只能选择文件名 我现在需要选择文件夹
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JS实现打开文件夹对话框</title>
</head>
<script language="javascript">
function chooseFolder(){
var savePath;
var objSrc=new ActiveXObject("Shell.Application").BrowseForFolder(0,'请选择文件目录:',0,'');
if(objSrc!=null){
savePath=objSrc.Items().Path;
document.all.savePath.value=savePath;
}
}
</script>
<body>
<input type="te" size="30" name="savePath"/>
<input type="button" name="chosefolderbutton" value="选择" onclick="chooseFolder()"/>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JS实现打开文件夹对话框 </title>
</head>
<script language="javascript">
function chooseFolder(){
var savePath;
var objSrc=new ActiveXObject("Shell.Application").BrowseForFolder(0,'请选择文件目录:',0,'');
if(objSrc!=null){
savePath=objSrc.Items().Path;
document.all.savePath.value=savePath;
}
}
</script>
<body>
<input type="te" size="30" name="savePath"/>
<input type="button" name="chosefolderbutton" value="选择" onclick="chooseFolder()"/>
</body>
</html> 为什么你的代码提示 没有权限。。
看看这个 是不是你要的
就用<input type="file" >
可是 用 第三方控件弹出来的另存为 有些浏览器支持不是很好。。
现在问题解决了, 首先把他我需要的文件上传服务器上 然后通过下载的方式让他选择路径 。这是唯一的办法了 呵呵