lundi 11 mai 2015

Download Excel with pivot table IE appending [1] to file name

Currently I am face this isuue.

when I am directly opening from IE with out saving , IE adding [1]/Version to file name

Example:Test.xlsx file in backend but when i am opening the file its renamed to Test[1].xlsx.And this is creating the issue.

Can any one suggest what I am doing wrong here.

Thanks!!

//res.setContentType("application/vnd.ms-excel");
               //res.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
               //res.reset();
               //res.setHeader("Expires", "0");

      myDownloadTask{
              //res.setHeader("Cache-Control","must-revalidate,post-check=0, pre-check=0");
               //res.setHeader("Pragma", "public");
               //res.setContentType("application/force-download");
               //res.setHeader("Content-Transfer-Encoding", "binary");
               res.setContentType("application/ms-excel; charset=UTF-8");
               res.setCharacterEncoding("UTF-8");

               fileName=EncodeFileName(fileName);

               res.setHeader("Content-Disposition","attachment; filename="+fileName);

}

Aucun commentaire:

Enregistrer un commentaire