manish250 0 Junior Poster in Training

hello all

I am having a problem when i download the files from the browser there are 2 blank lines on top and 2 blank lines in the last.while in the original file on the system there is no
blank line.Code is as follows

Thanks in advance

<jsp:useBean id="campaign" class="com.cellebrum.campaginManager.hourlyMIS" scope="page"/><jsp:setProperty name="campaign" property="*"/><%@ include file="authentication.jsp"%><%@ page import ="java.util.*"%><% String strDateTime = request.getParameter("strHour");
        //System.out.println("success logs:"+strDateTime+"");
String date=request.getParameter("strDate");
  System.out.println("date is"+strDateTime+"");
    strDateTime=strDateTime.replaceAll("-","");
    //strDateTime=strDateTime.substring(2,10);
    //date=date.replaceAll("-","");
  String strCli = request.getParameter("strcli");
   String strFileName = strCli+"_success_"+strDateTime+".txt";
   String strSuccLogs = "";
ArrayList array = new ArrayList();
    array = campaign.getYesterdaySuccLogs(strDateTime,strCli);
    if(array.isEmpty()==false){
    Iterator itr = array.iterator();
response.setContentType("Text/html");
 response.setHeader("Content-Disposition","attachment;filename="+strFileName+"");
    while(itr.hasNext()){
    //System.out.println("Success"+itr.next());
        strSuccLogs = (String)itr.next();
    strSuccLogs =strSuccLogs.trim();
    out.println(strSuccLogs);}
    }else{
     out.println("No Data present");
    }
%>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.