on 08-21-2011 10:02 PM
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
Done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.