> Od: "Daniil Sosonkin" <dan...@orbisfn.com>
> Komu: Stripes Users List <stripes-users@lists.sourceforge.net>
> Datum: 30.07.2010 14:46
> Předmět: Re: [Stripes-users] File Download
>
>There's nothing wrong with the code, but everyone sees that. So perhaps the 
>problem lies in your web server - tomcat or whatever you're using. The problem 
>with these errors is that there's no stack trace available so its hard to 
>figure out where the issue actually is. After looking at the 
>StreamingResolution, I see that it uses PrintWriter to send back the output 
>for the Reader. Perhaps you can override stream method and use 
>ServletOutputStream instead of PrintWriter, although you're passing 
>InputStream so it wouldn't apply. Somewhere down the line, there is too much 
>buffering going on. I've written a video download ActionBean some years ago; 
>it was sending 100MB files with no problems. The code is below and is 
>identical to yours. How much memory to give to your application engine?


I'm not sure about these memory things, but I'm using default setting of 
glassfish 2 (glassfish-installer-v2-b58.jar, downloaded from this page 
http://dlc.sun.com.edgesuite.net/javaee5/promoted/Linux/) on Ubuntu 9.10.


>
>                return new StreamingResolution("application/octet-stream") {
>                    protected void stream(HttpServletResponse response) throws 
>Exception
>                        {
>                            String sp = File.separator;
>                            InputStream in = new 
>FileInputStream(video.getLocation() + sp + video.getFilename());
>                            try
>                                {
>                                    OutputStream out = 
>response.getOutputStream();
>
>                                    byte[] buf = new byte[1024 * 65];
>                                    int size = 0;
>
>                                    while ((size = in.read(buf)) > 0)
>                                        out.write(buf, 0, size);
>                                }
>                            finally
>                                {
>                                    in.close();
>                                }
>                        }
>                }.setFilename(video.getOriginalFilename());
>            }

This resolution is working like the other ones. I tried this one also: 
http://www.stripesframework.org/display/stripes/AJAX#AJAX-MoreEfficientRealTimeStreaming
 But the problem is still there.

Maybe the best way to do this thing is put files somewhere here 
glassfish/domains/domain1/docroot and send direct links to clients.

But thanks a lot anyway, Radim

>
>
>Daniil
>

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to