Well,
I am working under Windows XP SP 2 for the test of servlet and JSP. After
that , I move all the work on a server Debian station.
Strangely, I have no error message (I searched on TomCat logs, I have found
nothing). Error logs can be elsewhere ?
I am using Netbeans 4.1 and Java 1.5.0.0_4
Thank you.
Maxime
>perhaps you can describe your problem a little bit more, for example: do
>you getting an error message, stack trace or something. on what >platforms
>are you working windows, linux, ...
> -----Ursprüngliche Nachricht-----
> Von: Maxime [mailto:max.dev@free.fr]
> Gesendet: Donnerstag, 7. Juli 2005 10:19
> An: commons-user@jakarta.apache.org
> Betreff: [FileUpload] It's works under Firefox but not on IE, why ?
>
> Hello Everybody,
> During 2 days, I was testing FileUpload on IE and it never
> work. After that, I tried on Firefox and it's works perfectly.
> Can you tell me why and how to resolve this problem ?
> It's a really pain in an ... :)
>
> Thank you.
> Maxime
>
>
>
> Here the form :
>
>
>
>
>
>
> Upload de Fichier
>
>
>
>
>
> Here the Servlet :
>
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import org.apache.commons.fileupload.*;
> import org.apache.commons.fileupload.*;
>
>
> public class UploadFileServlet extends HttpServlet {
> public void doPost(HttpServletRequest request,
> HttpServletResponse response)
> throws ServletException, IOException {
>
> System.out.println ("Uploading-Servlet");
> try{
> // Create a new file upload handler
> DiskFileUpload upload = new DiskFileUpload();
>
> // Set upload parameters
> int yourMaxMemorySize = 512 * 1024 * 8;
> int yourMaxRequestSize = 1024 * 1024 * 8;
> String yourTempDirectory = "c:\\";
>
> upload.setSizeThreshold(yourMaxMemorySize);
> upload.setSizeMax(yourMaxRequestSize);
> upload.setRepositoryPath(yourTempDirectory);
>
> //Parse the request
> List items = upload.parseRequest(request);
>
> // Process the uploaded items
> Iterator iter = items.iterator();
> while (iter.hasNext()) {
>
> FileItem item = (FileItem) iter.next();
>
> // Process a regular form field
> if (item.isFormField()) {
> String name = item.getFieldName();
> String value = item.getString();
>
> }
> // Process a file upload
> else {
> String fieldName = item.getFieldName();
> String fileName = item.getName();
> String contentType = item.getContentType();
> boolean isInMemory = item.isInMemory();
> File uploadedFile = new
> File(yourTempDirectory + fileName);
> item.write(uploadedFile);
>
> }
> }
> } catch (ServletException e) {
> e.printStackTrace();
> } catch (IOException e) {
> e.printStackTrace();
> } catch (FileUploadException e) {
> e.printStackTrace();
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> }
>
> }
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org