Download error when using HttpServletResponse through ServletUtils

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Download error when using HttpServletResponse through ServletUtils

This code only works with Firefox:

         public void run(Representation entity) {
             HttpServletResponse httpServletResponse = null;
             try {
                 httpServletResponse =
                 OutputStream buffOs = new
                 CountingOutputStream countingOutputStream = new
                 OutputStreamWriter outputWriter = new
"File Transfer");
                         "attachment;filename=\"" + FILE_NAME + ".csv\"");
                 CSVFunction method = new CSVFunction(outputWriter);
                 System.out.println("TOTAL BYTES: " +
countingOutputStream.getCount() + "");
             } catch (Exception e) {

I have tried Chrome and Opera browsers but all of those are throwing a
Download error. The `CSVFunction` takes a bit of time to finish,
processing around 30K rows. I wonder why Firefox can handle this
properly and while Chrome and Opera cannot. The only time this works
with Chrome is if I force the row processing to say 200 rows only (fast)
then it works and returns the CSV generated.

What could be wrong here? Is there a workaround that this could work
with Chrome?

*The CSVFunction is basically based on*

You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].