Re:number of Files download problem in jsp
I write code for single file downloading , but I want to download number of files at same time , means I want stored number of files in one temp zip file then it download it. please help in this case ...
code :
<%@ page import="java.io.FileInputStream" %>
<%@ page import="java.io.BufferedInputStream" %>
<%@ page import="java.io.File " %>
<%@ page import="java.io.IOException" %>
<%@ page import="java.util.*" %>
<%
String dwFilename ="C:\\downloadJSP\\raj.zip";
response.addHeader("Content-Disposition","attachment; filename="+dwFilename );
// set the http content type to "APPLICATION/OCTET-STREAM
response.setContentType("APPLICATION/OCTET-STREAM");
// initialize the http content-disposition header to
// indicate a file attachment with the default filename
BufferedInputStream buf=null;
ServletOutputStream myOut=null;
try {
myOut = response.getOutputStream();
File myfile = new File(dwFilename);
// set response headers
response.setContentType("text/plain");
response.addHeader("Content-Disposition","attachment; filename="+dwFilename );
response.setContentLength( (int) myfile.length( ) );
FileInputStream input = new FileInputStream(myfile);
buf = new BufferedInputStream(input);
int readBytes = 0;
//read from the file; write to the ServletOutputStream
while((readBytes = buf.read( )) != -1)
myOut.write(readBytes);
} catch (IOException ioe){
throw new ServletException(ioe.getMessage( ));
} finally {
//close the input/output streams
if (myOut != null)
myOut.close( );
if (buf != null)
buf.close( );
}
%>
<p>Files: <%=dwFilename%></p>
View Answers
Related Tutorials/Questions & Answers:
Re:number of Files download problem in jsp - JSP-ServletRe:
number of
Files download problem in jsp I write code for single file downloading , but I want to
download number of
files at same time , means I want stored
number of
files in one temp zip file then it
download it. please
upload and download files - JSP-Servletupload and
download files HI!!
how can I upload (more than 1 file) and
download the
files using
jsp.
Is any lib folders to be pasted? kindly... and
download files in
JSP visit to :
http://www.roseindia.net/
jsp/file_upload
Advertisements
Upload and Download Large files in jspUpload and
Download Large
files in jsp I am not able to
download large
files (>200mb) from any server. I need a code to
download and upload large
files (atleast 4 gb) to a server using
jsp page
Problem in downloading files - JSP-ServletProblem in downloading files Hi,
i have uploaded some
files using
its uploading successfully.
but when downloading the same file, its giving...:148)
at org.apache.jsp.downloadfile_
jsp._jspService(downloadfile_jsp.java:146
download pdf filesdownload pdf files pls help me,I don't know how to convert .doc,.docx
files into pdf
files and
download that pdf
files using servlet or
jsp Upload and Download multiple filesUpload and
Download multiple files Hello Sir/Madam,
I need a simple code for upload and
download multiple
files(it may be image,doc... using
jsp with sqlserver ,can you please provide a proper coding for it and also
Problem in jsp.Problem in
jsp. hello friends, I have a
problem in jsp.I want to insert data, which is given by user through a html page into a table.And the table..." action="http://localhost:8080/examples/
jsp/insertdata.jsp">
<table>
<
Problem in jsp.Problem in
jsp. hello friends, I have a
problem in jsp.I want to insert data, which is given by user through a html page into a table.And the table..." action="http://localhost:8080/examples/
jsp/insertdata.jsp">
<table>
<
Problem in jsp.Problem in
jsp. hello friends, I have a
problem in jsp.I want to insert data, which is given by user through a html page into a table.And the table..." action="http://localhost:8080/examples/
jsp/insertdata.jsp">
<table>
<
Jsp problemJsp problem Hello friends.I want to share my
jsp problem.I want to show all of my database(mysql) tables except two(user,manufacturer) in a
jsp page.plssss help me
jsp problemjsp problem
problem::::::::
On
JSP form ,when i insert data in text field........at that time action is perform and data is retriev from data base and get assign to other field on that form........
when data is assign to other
jsp problemjsp problem Hello Friends,
I want to show one page for 5 seconds and after that i want to redirect the page to another URL
jsp problemjsp problem Hi every one plz give me answer for below question ASAP
I created one
JSP(used pre defined javascript in
jsp to get rtf format in browser) which creats RTF Format in browser to enter data.
MY question is after i
JSP Problem - JSP-ServletJSP Problem Hi,
I have
problem,this is my senario
I have one
jsp,this
jsp having the 3 fields.let me take 3fields userName,emailAddress... for more information,
http://www.roseindia.net/
jsp
Thanks
jsp problem - JSP-Servletjsp problem here is a code for Retrieving image from mysql database through
jsp.
but i cann't set size of image when it was display so what should... working but my
problem is size of image.
so can u just help??
code
jsp problem - JSP-Servletjsp problem here is a code for Retrieving image from mysql database through
jsp.
but i cann't set size of image when it was display so what should... working but my
problem is size of image.
so can u just help??
code
Upload and Download in JSP - JSP-Servlet and downloading a file in
JSP..
When the admin clicks upload, he must be able to upload
files and similarly when the user clicks the
download option, he must be able...Upload and
Download in JSP Respected Sir/Madam,
I am
jsp problem - JSP-Servletjsp problem hi, i am working on a project of developing a shopping cart for online book store.can it be done using
jsp?if yes,
can u please help me doing so? Hi Friend,
Please visit the following link:
http
problem in jsp programming - JSP-Servletproblem in
jsp programming Write a
JSP program which displays a webpage containing arrival of new items within a particular month in the different... in solving the
problem :
Connection with mysql database
download or save jsp pagedownload or save
jsp page hii..,
this is my
jsp page .. This page is theater ticket. i want to
download this page. so i need to save this page or
download.. that depend on user wish how to make this page save or
download
<
download or save jsp pagedownload or save
jsp page hii..,
this is my
jsp page .. This page is theater ticket. i want to
download this page. so i need to save this page or
download.. that depend on user wish how to make this page save or
download
<
JSP file download - JSP-ServletJSP file download Hi!
I am saving (webapp/docs/sample.docx) path of the word file in database. when i want to
download that file i am eliminating... on the link it is asking open or save.
Upto this is fine.....
I want to
download problem in programming - JSP-Servletproblem in programming Hi!
I am new with
jsp. I am facing a
problem in programming to calculate the time interval between login time and logout time of user
jsp code problem - JSP-Servletjsp code problem Hi,
I have employee details form in
jsp. After... have a
problem with open the next form. plz, help me.
thanks, Hi....
http://www.roseindia.net/
jsp/
Thanks
Session Problem in JSP - JSP-ServletSession
Problem in JSP I have developed a online feedback form in
JSP platform. I have created normal session in
JSP page. It is running in my... normally from Remote machine by only writing
JSP code. Hi friend
File Download in jspFile
Download in jsp file upload code is working can u plz provide me file
download Download LINK - JSP-ServletDownload LINK sorry i am the new1 to java. I am learning and doing the project, can you please send me the complete code. So that i can understand easily. i want the code like by Clicking
DOWNLOAD button the SAVE as dialog box
download - JSP-Servletdownload here is the code in servlet for
download a file.
while...;
/**
*
* @author saravana
*/
public class
download extends HttpServlet...();
System.out.println("inside
download servlet");
BufferedInputStream
Download Button - JSP-ServletDownload Button HI friends,
This is my maiden question.... And i want the Bank customers to
DOWNLOAD the mini statement. Can any one help me how to implement the
download button so that on clicking that the mini
jsp usebean problem - Struts popupwindow
jsp below code run..
...here iam getting the
problem..in the below...
jsp usebean problem
--Select...
jsp File Upload And download JSP Urgent - JSP-ServletFile Upload And
download JSP Urgent Respected Sir/Madam,
I...
Download in
JSP.. In the Admin window, There must be "Upload" provision where admin can upload
files.. And in the user window, There must be a "
Download" provision
Java Problem - JSP-ServletJava Problem How to run a Simple
JSP program ? what steps... the webapps folder of apache tomcat.
5)Create a
jsp file 'hello.jsp'.You can put your
jsp file either inside the web application folder along with WEB-INF or you
logout problem?? - JSP-Servletlogout
problem?? sir,
the logout code which u have send is not the proper solution coz,by using this code the browser get closed which shuold.../Logout.shtml
http://www.roseindia.net/
jsp/loginstatus.shtml
Thanks
logout problem.. - JSP-Servletlogout
problem.. hi...
first of all thanks for ur... but their is some
problem with the the logout,i m not able to logout when... done in the code i have used session object in project's servlet and
jsp coding problem - JSP-Servletcoding problem dear sir i m very new to
JSP sir i m getting
problem in dynamically changing the option of combobox from database(ms acess) .and after that option being selected for that the record from the databse should
Uploading Multiple Files Using Jsp Uploading Multiple
Files Using
Jsp
... to understand how you can upload multiple
files by using the
Jsp.
We should avoid to use
Jsp for performing any logic, as
Jsp is mainly used for the presentation
JSP Upload and Downloading files - JSP-Servlet and downloading
files in
JSP, I am facing a
problem..
1) The file name is getting inserted in the database successfully. But When I
download the same file, The contents...
JSP Upload and Downloading files Respected Sir/Madam,
Very
tomcat problem - JSP-Servlet the tomcat server.
It stops at this stage during installation .......c:\program
files... perfectly.
Kindly let me know what is the
problem at an earliest.
Thanking... found your
problem..
http://www.roseindia.net/web-application-server/tomcat
JSP code problem - JSP-ServletJSP code problem Hi friends,
I used the following code...:
<%
//to get the content type information from
JSP... of:
Please can somebody rectify this
problem........