To upload from client to Server is ok but how to download files from server
?
Please send the code for the same if you have.

Sandeep

----- Original Message -----
From: Alfonso de Castro <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 24, 2000 3:48 PM
Subject: Re: Upload a file using JSP


Suppose you have a HTML file like this:

<html>
<body>
<form action="receive.jsp" method="POST" enctype="multipart/form-data">
 <input type="file" name="file2">
 <input type="submit" name="enviar">
</form>
</body>
</html>

it�s important to add the enctype="multipart/form-data" if you don�t put it,
you�ll receive the file name.

For getting the content use:

<%@ page language="java" import="java.util.*" %>
<html>
<body>
<%
 Enumeration Cabeceras=request.getHeaderNames();
 while (Cabeceras.hasMoreElements()){
  String atrib=(String)Cabeceras.nextElement(); %>
  <%= atrib %>
  <%= request.getHeader(atrib) %>
  <br>
<% }
%>
<hr>
<%
 byte[] matriz = new byte[10000];
 ServletInputStream stream = request.getInputStream();
 stream.read(matriz);
 String cadena = new String(matriz); %>
 <%= cadena %>
<hr>
</body>
</html>

this code will show you the headers the page receives and the first 10000
bytes of the file.

----- Mensaje original -----
De: Alireza Nahavandi <[EMAIL PROTECTED]>
Para: <[EMAIL PROTECTED]>
Enviado: lunes 23 de octubre de 2000 21:48
Asunto: Upload a file using JSP


> Hi everybody,
>
> How can I upload a file to server using JSP ?
>
> Thank you,
> Alireza.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to