cancel
Showing results for 
Search instead for 
Did you mean: 

zip download CRC error javascript

Former Member
0 Kudos

zip download CRC error javascript

Hello xperts, i am trying to develop a jsp page containing a javascript code which should download a zip file, i have a script that works fine for this as a separated part ,but when i intgegrate this code to anoter, it download the .zip file corrupted

the separated code is as follows:

Should i fix anything in this individual code?

Tanx in advance!!

String ubicacion="";

String packzip="fileone.zip";

ubicacion="C:
"+packzip;

response.setContentType("application/zip");

response.addHeader("Content-Disposition", "attachment; filename="+packzip);

try{

File Zarchivo= new File(ubicacion);

int TamZarch=(int)Zarchivo.length();

FileInputStream fEnt = new FileInputStream(Zarchivo);

PrintWriter Mnsj = response.getWriter();

int c=-1;

while ((c = fEnt.read()) != -1){

Mnsj.print((char)c);

}

fEnt.close();

Mnsj.flush();

Mnsj=null;

}catch(Exception e){

}

%>

Finally i send the java script code (sdn page cannot save this part but it consists on the following steps:)

settting window pop up name

setting window parameters

opening the file

setting timeout to 5000 ms

closing window

Edited by: NWrscr on Aug 21, 2011 11:35 PM

Edited by: NWrscr on Aug 21, 2011 11:39 PM

Edited by: NWrscr on Aug 22, 2011 12:42 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Done

Former Member
0 Kudos

ok