i have to put a doanload link in a jsp page <a href="/test/xyz.zip"></a>
but i have the xyz file in local drive c:\\download\xyz.zip i am generating the file in local folder i can't put it in the server root. how to map the download file from local drive to server path without copying the file into server path ? thanks in advance
thanks for the response fallowing code modified from the example you have reffered when i am running this servlet its opening a download dialog box asking for downloading the servlet.java file instead of java.zip file ?
thanks for the answer . its working now but the save dialogbox i am getting the servlet name as default name to save ,instead of it how to get the test.zip file name as deafult name .
i have set the name in Content-Disposition as fallows resp.setHeader(filename,"inline;filename=\""+filename +"\""); by this i could get the file extenison correctly but still name of the file it takes as name of servlet. advice
i commented the line resp.setHeader(filename,"inline;filename=\""+filename +"\""); i am getting same result . why application is not picking up setHeader ?
i changed the content type to contentType = "application/x-zip"; resp.setHeader("Content-Disposition", " inline; filename=" + filename); then its working
thanks for the responces till now they are very helpful to me
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop