[jboss-user] [JBoss Seam] - Re: Usage for downloading uploaded file
tino4 wrote : carloszaniolo wrote : Sorry, | | | | public void download() | | is from textmcontroller. | | | | The other is my download helper method and is the important one... | | thank you sirit works... | | but the downloaded file type is undefined, so that you can't open it. | the file is converted from blob into byte. | the size is correct. | well i think it's just a convert problem.. | i'm still working on it and try to fix it. | i let you know | Hi Carloszaniolo, it's working now. now i can open the downloaded uploaded file. the problem like i said was the convert itself. well actually you don't need to convert at all :) thank you sir View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4065655#4065655 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4065655 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Usage for downloading uploaded file
Hi carlos, thx for your responds. i still don't understand, which one is your textmcontroller java code? thx in advance View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4065318#4065318 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4065318 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Usage for downloading uploaded file
Sorry, public void download() is from textmcontroller. The other is my download helper method and is the important one... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4065364#4065364 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4065364 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Usage for downloading uploaded file
carloszaniolo wrote : Sorry, | | public void download() | is from textmcontroller. | | The other is my download helper method and is the important one... thank you sirit works... but the downloaded file type is undefined, so that you can't open it. the file is converted from blob into byte. the size is correct. well i think it's just a convert problem.. i'm still working on it and try to fix it. i let you know View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4065392#4065392 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4065392 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Usage for downloading uploaded file
twocoasttb wrote : You have to write a servlet to do this. I think the seamspace app provides a good example. hi, could you plz give some more infos ? i can't find it in seamspace examples thx View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4064925#4064925 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4064925 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Usage for downloading uploaded file
Hi, try this: s:link value=Donwload #{textm.name} rendered=#{! empty textm.text} action=#{textmcontroller.download} / public void download() { | if (textm.getText() != null) { | byte[] file = loadFile(); | String name = getName(); | String type = getContentType(); | MyUtil.download(file, name, type); | } | } public static void download(byte[] file, String name, String type) { |FacesContext facesContext = (FacesContext) Component.getInstance(facesContext); |if (!facesContext.getResponseComplete()) { |HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse(); |response.setContentType(type); |response.setContentLength(file.length); |response.setHeader(Content-disposition,attachment; filename= + name); |ServletOutputStream out; |try { |out = response.getOutputStream(); |out.write(file); |out.flush(); |} catch (IOException e) { | //TODO: something |} |facesContext.responseComplete(); |} |} View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4065117#4065117 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4065117 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Usage for downloading uploaded file
But it wold be usefull to have in Seam: s:filedownload name=#{name} contentType=#{type} file=#{file} / View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4065124#4065124 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4065124 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Usage for downloading uploaded file
You have to write a servlet to do this. I think the seamspace app provides a good example. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4063313#4063313 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4063313 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user