All,

I am trying to upload a file to the server using the input type file and
setting enctype="multipart/form-data" in the form. I've tried using the
DiskMultipartRequestHandler in my action class, but keep getting a null
pointer exception when I call the handleRequest method. Apparently it
happens when the tempDir is being looked up. To get round this I tried
putting the following in my web.xml under the <servlet> entry for the struts
action servlet:

        <init-param>
            <param-name>maxFileSize</param-name>
            <param-value>250M</param-value>
        </init-param>        
        <init-param>
            <param-name>multipartClass</param-name>
 
<param-value>org.apache.struts.upload.DiskMultipartRequestHandler</param-val
ue>
        </init-param>        
        <init-param>
            <param-name>tempDir</param-name>
            <param-value>/WEB-INF/temp/</param-value>
        </init-param>

I've also tried the tempDir as /WEB-INF/temp and C:\

But I still get the null pointer exception:

java.lang.NullPointerException
        at
org.apache.struts.upload.DiskMultipartRequestHandler.retrieveTempDir(DiskMul
tipartRequestHandler.java:207)
        at
org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti
partRequestHandler.java:63)

Any help would be greatly appreciated.

Cheers,
Jon.


=**********************************************************

If you are not the intended recipient, employee or agent responsible for delivering 
the message to the intended recipient, you are hereby notified that any dissemination 
or copying of this communication and its attachments is strictly prohibited.

If you have received this communication and its attachments in error, please return 
the original message and attachments to the sender using the reply facility on e-mail.

Internet communications are not secure and therefore the UCLES Group does not accept 
legal responsibility for the contents of this message.  Any views or opinions 
presented are solely those of the author and do not necessarily represent those of the 
UCLES Group unless otherwise specifically stated.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses although this does not guarantee that 
this email is virus free.

**********************************************************=

Reply via email to