1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem in header and content type

Discussion in 'ASP' started by vijayz, Apr 10, 2008.

  1. vijayz

    vijayz New Member

    Joined:
    Apr 10, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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
    Code:
    response.setHeader("Content-Disposition", "inline; filename=" + title+".xls");
    			response.setHeader("Cache-Control",
                 "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);
    			ot.flush();
    			ot.close();
    			}
    i would like to know how to set the headers and content type?..........
     
    Last edited by a moderator: Apr 10, 2008

Share This Page