67,513
社区成员
发帖
与我相关
我的任务
分享
String UpLoad(){
file = this.getFile();
fileNmae = this.getFileNmae();
}
private File myFile;
private String FileName; //文件名
private String FileContentType; //文件类型
setter and getter functions...
function check(){
var fileInputContext = document.getElementById("file").value;
var fileNmae = fileInputContext.substring(fileInputContext.lastIndexOf("\\")+1,fileInputContext.length);//获取上传文件的文件名
}
<form enctype="multipart/form-data" action="" onsubmit="return check();">
<input type="file" name="file" id="file">
</form>