1. #1
    Sencha User
    Join Date
    Dec 2012
    Location
    India
    Posts
    8
    Vote Rating
    0
    tanujkhanna9 is on a distinguished road

      0  

    Default Unanswered: ExtJs 4 need to read Response Stream to create CSV file

    Unanswered: ExtJs 4 need to read Response Stream to create CSV file


    Hi
    I have created an AJAX Request of Post Nature.

    Servlet code accepts the Post request and processes it. doPost() method writes the csv File to the responseStream .

    This response should have been handled by the browser but when it reaches the success function of AjaxRequest, I just find my csv text embedded in an object.

    Following below is the code:

    UI Side
    Ext.Ajax.request({
    ur;:'ExportCsvServlet',
    method:'POST',
    params:{"test":"testParam"},
    success:function(response){
    console.log('we are success')'
    },
    failure:function(response){
    console.log('we are failure')'
    }
    });


    Servlet Code

    doPost(request,response){

    response.setHeader("Contet-type","text/csv");
    response.setHeader("Content-Disposition","attachment; filename=test.csv");
    PrintWriter writer = response.getWriter();
    writer.append("a,b,c");
    writer.flush();
    writer.close();
    }

    Please suggest how to make sure, the file is downloaded ??? any ideas,

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi