<script>
//取文件後綴名
function GetFileExt(filepath) {
if (filepath != "") {
var pos = "." + filepath.replace(/.+\./, "");
return pos;
}
}
//取文件名不帶後綴
function GetFileNameNoExt(filepath) {
if (filepath != "") {
var names = filepath.split("\\");
var pos = names[names.length - 1].lastIndexOf(".");
return names[names.length - 1].substring(0, pos);
}
}
//取文件全名名稱
function GetFileName(filepath) {
if (filepath != "") {
var names = filepath.split("\\");
return names[names.length - 1];
}
}
</script>