aspose file tools*
The moose likes Servlets and the fly likes MultipartRequest class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "MultipartRequest class" Watch "MultipartRequest class" New topic
Author

MultipartRequest class

fahim chowdhury
Greenhorn

Joined: Jul 14, 2002
Posts: 9
Does anyone know where I can find a functional MultipartRequest class? I tried using the one from the OReilly book, but it seems to have bugs.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Have you tried the file available from their website? Perhaps the copy that came with your book is flawed and a new version is available.
Otherwise, a quick search on google turns up lots of hits.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Conie Ooi
Ranch Hand

Joined: Jun 09, 2002
Posts: 31
You can download the classes from http://www.servlets.com/cos/index.html
fahim chowdhury
Greenhorn

Joined: Jul 14, 2002
Posts: 9
Yes, I am using the MultipartRequest class from the oreilly site, but I still have an error when I try to utilize the class. I put the MultipartRequest class file in the same folder as the servlet that calls its constructor. Here is the error:
C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\WEBINF\classes\com\oreilly\servlet\uploadservlet.java:17: cannot access MultipartRequest
bad class file: C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\WEB-INF\classes\com\oreilly\servlet\MultipartRequest.class
class file contains wrong class: com.oreilly.servlet.MultipartRequest
Please remove or make sure it appears in the correct subdirectory of the classpath.
MultipartRequest request = new MultipartRequest(req,"MyUploads\test");
^
1 error
Process completed.
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
The best way for using the class is including the jar file in the WEB-INF/lib directory.
You dont need to put the servlet which calls the constructor in the same dir.
Anyway, make sure you have in the classpath not only the MultipartRequest class, but the complete package or at least the other classes used by MultipartReques class (like MultipartParser, Part FilePart, ParamPart, FileRenamePolicy, etc...)
 
Don't get me started about those stupid light bulbs.
 
subject: MultipartRequest class