Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/forums/asp/)
-   -   problem in header and content type (http://www.go4expert.com/forums/header-content-type-t9902/)

vijayz 10Apr2008 11:36

problem in header and content type
my application aim is to download and upload data from excel sheet to mysql and mysql to excel sheet

while downloading the data from mysql to excel my application fails, using Internet explorer . i can download only empty excel sheet and the data is not present.

the headers i have i have used are

response.setHeader("Content-Disposition", "inline; filename=" + title+".xls");
            "must-revalidate, post-check=0, pre-check=0");
                        response.setHeader("Pragma", "no-cache");
                        response.setHeader("Expires", "0");
                        response.setContentType("application/vnd.ms-excel: xls, xlb: Microsoft Excel Document");
                        ServletOutputStream ot = response.getOutputStream();
                        byte[] blobdata1 = wb.getBytes();
                        int off = 0;
                        int l = (int) wb.getBytes().length;
                        log.debug("Document Length is " + l);
                        ot.write(blobdata1, 0, l);

i would like to know how to set the headers and content type?..........

All times are GMT +5.5. The time now is 16:07.