jsp怎样获得文件夹?(类似HTML 的file控件)
用什么方式实现都行。。
Java code:
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" na
相关问答:
我现在想用ssh整合来做一个论坛,但数据库方面不行,我主要不会涉及数据库,不知道发帖表,和回帖表要如何设计和区分。不知道谁有一个简单的思路,来设计这些表。谢谢了。
发帖和回帖用同一张表 。发帖 id user ......
我想登录后,如果登录成功就去执行某个页面
我现在的代码是这样的:
if(rs.next()){
session.setAttribute( "username" , user);
<jsp:include page="login.jsp" />// ......
我想用javabean实现计数
代码如下:
ComputerCount.java
package tom.jiafei;
import java.io.*;
public class ComputerCount{
int number=0;
boolean iscome=false;
File file=new ......
我的程序如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv=&q ......
<html><head><title>[@title]</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<script language='javascript'>
function diyCheck ......