----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

There's information on a MulipartRequest class at

http://www.servlets.com/resources/com.oreilly.servlet/index.html

that can solve your problems.  Licensing requires purchase of O'Reilly's Java Servlet 
Programming, which I would recommend anyways as a handy reference.

Aaron Schinkowitch
Sr. Engineer
Web-X LLC

[EMAIL PROTECTED]
http://www.web-x.com
253-627-7596

>>> Rupert Huelsey <[EMAIL PROTECTED]> 10/30 3:33 AM >>>

Hi there,

I've got a severe problem concerning file uploads using ApacheJserv. I
know some of the implementations performing a file upload (encryption
type multipart) using the InputStream to handle multipart request. This
leeds to an empty HttpRequest (at least as far as I figured out) and a
custom request which contains all parameters and the path to the
uploaded file in the filesystem; whatever - depending on the
implementation.

I have to solve the problem in a slightly different way: the request has

to be filled with the values. Consider the following example:

...
<form name=foo action=/foo/bar method=post
enctype=multipart/form-data>
...
<input type=text name=whoAmI>
<input type=file name=myCard>
...
</form>
...

together with the following servlet :

public class myServlet extends HttpServlet
{
    public void doPost (HttpRequest req, HttpResponse res) throws ...
    {
        ...
        out.println ("You are: "+(String)req.getParameter ("whoAmI"));
        out.println ("your file is stored in the remote FS:
"+(String)req.getParameter ("myCard"));
        ..
    }
}

it should deliver a page like this:

You are: Rupert
your file is stored in the remote FS:
/home/rupert/uploadedFiles/fileIJustUploadedUsingMyGreatServlet.txt


I think the key questions are:
-    is the HttpRequest able to handle multipart/form-data (it seems to
me it isn't)
-    is there a way to patch the HttpRequest (do you have to change the
source of org.apache.jserv.? or org.apache.java.?)





--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to