我想获得一个浏览的文件路径。我试过喜欢它
Object objUploadEvent = ctx.getTriggerEvent();
if (objUploadEvent != null && (objUploadEvent instanceof UploadEvent)) {
upEvent = (UploadEvent) objUploadEvent;
}
if (upEvent != null) {
Media media = upEvent.getMedia();
File file=new File(media.getName());
this.path = file.getAbsolutePath();
}
但是 getAbsolutePath 是从日食中给出路径。说如果我的文件在 c://doc/abc 中,那么它应该给出路径为 c://doc/abc/myfile.txt
谢谢