Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/10/2007, 03:41
Avatar de cris_maco
cris_maco
 
Fecha de Ingreso: abril-2007
Ubicación: Salamanca
Mensajes: 254
Antigüedad: 17 años
Puntos: 0
Re: leer txt del cliente desde una pagina web

no se si te referiras a algo asi:

Código PHP:
try
{
InputStream in = new FileInputStream(ruta);

byte[] data = new byte[in.available()];
in.read(data);

response.setContentType("application/msword;");//porque yo leo word, seria cambiar a tipo text


response.setHeader("Content-Disposition","inline; filename=\"nombre.txt"";");
response.setContentLength(data.length);
javax.servlet.ServletOutputStream servletoutputstream response.getOutputStream();

servletoutputstream.write(data);
servletoutputstream.flush();
servletoutputstream.close();
} catch (
IOException e) {
System.out.println("error:"+e.getMessage());
//Trace.exception(this,".jsp-->IOException"+e.getMessage());