首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

音频文件上传之后播放不了的怎么处理

2012-05-04 
音频文件上传之后播放不了的怎么办?把文件名改了一下Java codepublicString create() {String result c

音频文件上传之后播放不了的怎么办?
把文件名改了一下

Java code
public  String create() {                String result = "create_failure";        this.resourceService = new ResourceService();        this.resource.setUser((User)this.session.getAttribute("user"));                //取扩展名        String[] tmp = this.resource.getUpFileFileName().split("\\.");        String fileType = tmp[tmp.length-1];        this.resource.setFiletype(fileType);                //filePath = 上传路径 + userid +文件名        String filePath = ServletActionContext.getServletContext().getRealPath("/resource")                  + "/" + this.resource.getUser().getUserid() + this.resource.getUpFileFileName();                this.resource.setFilesize(this.resource.getUpFile().length());        this.resource.setPath(filePath);        File target = new File(filePath);        FileUploader.upLoadFile(this.resource.getUpFile(),target);        if (this.resourceService.create(this.resource)) {            result = "create_success";        }        return result;    }


[解决办法]
我也是

热点排行