有没有谁做过用jersey实现文件下载啊?
iphone/android后台,含一个参数,也就是一个地址,数据库保存的,前台调用,就能实现下载。网上的一段代码
Resource resource=(Resource)resourceService.getObject(Resource.class, id);
String path=servletContext.getRealPath(resource.getFilePath());
FileInputStream fis=new FileInputStream(new File(path));
byte [] b=new byte[fis.available()];
fis.read(b);
return b;
不能设置下载文件的名字,只适合小文件。没有考虑到大文件。
有没有哪位大侠熟悉这块的,请赐教啊。