Hey man...
cara, se vc puder esperar mais um pouco, estou terminando de desenvolver uma classe que faz exata.e este trabalho q vc descreveu...
 
[]'s
 
Daniel   
----- Original Message -----
Sent: Tuesday, October 30, 2001 6:52 PM
Subject: RES: [java-list] Tranferência de arquivo do Client-web (JSP e / ou HTML) para o Servidor-Web (Servlet)

Caro Alessandro,

 

            Agradeço pela resposta e, gostaria de comunicar-lhe que já tentei proceder da forma com  a qual você orientou-me mas, não obtive êxito! Talvez meu problema seja do lado do servidor. Usei o método servletInputStream() para receber o arquivo mas só consegui receber alguns caracteres estranhos. Não sei fazer as devidas conversões de Stream para poder gerar o arquivo recebido pelo servidor em FileOutputStream!

 

 

Obrigado,

Henrique Rocha

 

 

-----Mensagem original-----
De: Alessandro Romero [mailto:[EMAIL PROTECTED]]
Enviada em: terça-feira, 30 de outubro de 2001 15:53
Para: [EMAIL PROTECTED]
Assunto: Re: [java-list] Tranferência de arquivo do Client-web (JSP e / ou HTML) para o Servidor-Web (Servlet)

 

Henrique Rocha,

 

        Tirei isso do www.jguru.com... Vai te ajudar!!!

 

you can upload a file using HTTP, but you need to write a servlet or a CGI script or some other server-side executable to receive the incoming file.

To send the file, create an HTML form for the client to use. Your form field should have input type "file" to let the user browse and select the file to be uploaded. Also, your form tag should have the "enctype=multipart/form-data" attribute in order to successfully pass file's contents to web server using HTTP. For example, the HTML form tag might look like this:

<FORM method="POST" action="someservlet" enctype="multipart/form-data">
form fields
<INPUT type="file" name="file1">
</FORM>

You can get further information regarding processing HTML forms from: http://www.w3.org/TR/WD-html40-970708/interact/forms.html

Use O'Reilly's servlet package to write the servlet which receives the file sent by the form. You can get O'Reilly's servlet package at http://www.servlets.com/resources/com.oreilly.servlet/

 

Abraços,

Alessandro.

----- Original Message -----

Sent: Tuesday, October 30, 2001 8:26 PM

Subject: [java-list] Tranferência de arquivo do Client-web (JSP e / ou HTML) para o Servidor-Web (Servlet)

 

Caros Colegas da Lista,

 

 

         Há tempos que tento mas, ainda não consegui realizar uma tranferência de arquivos entre um Cliente-Web (fJSP e / ou form HTML) e o Servidor-Web pois tenho dificuldade de manusear os métodos "servletInputStream()" , "doPut()" e / ou "doPost()". Se alguém da lista puder me orientar quanto à esta tarefa ficarei eternamente grato!

 

 

 

 

Obs.: Caso ninguém possa me ajudar, gostaria que ao menos me indicassem alguma literatura que exemplificasse este processo involvendo conversões de "Streams",  "forms HTML", "métodos servletInputStream()", "doPut()", "doPost()" e, qualquer outro método útil!

 

 

Muito Obrigado,

Henrique Rocha

 

Responder a