File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes file upload problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "file upload problem" Watch "file upload problem" New topic

file upload problem

Javed Sardar
Ranch Hand

Joined: Sep 10, 2002
Posts: 33
The following is the HTML code I am using to upload a file

IN my servlet when I try to get request.getContentType, it is returning null.
Could anybody please suggest when am I going wrong.
Thanks and Regards,
Arun Prasad Namasivayam

Joined: Jan 02, 2003
Posts: 5
You need to change the <form> attribute "encoding" to "enctype" thatz the only error i can see in the HTML.
keep smiling
M.K.A. Monster
Ranch Hand

Joined: May 02, 2002
Posts: 130
I've been using the oreilli classes, and when you look at these code there's something else interesting:
I agree. Here's the link:
subject: file upload problem
It's not a secret anymore!