Juan,

I'll contribute a small example to struts on how to use the file
upload/multipart request package

-----Original Message-----
From: Juan Gargiulo
To: [EMAIL PROTECTED]
Sent: 12/18/00 1:08 PM
Subject: RE: file upload

Can I get at least a pointer to documentation about how to do this?

thank you in advance, 

juan

-----Original Message-----
From: Juan Gargiulo [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 15, 2000 5:58 PM
To: [EMAIL PROTECTED]
Subject: file upload


Hi,

I'm trying to use the file upload features from struts. I know that this
is
suppose to be easy to use. But I keep receiving a null form in my
perform
method and I can't figure out the problem.

JSP code:
---------
<form:form action="upload.do" name="uploadForm" method="POST"
enctype="multipart/form-data" type="UploadForm">
<form:file property="file" />
<form:submit property="submit" value="Submit"/>
</form:form>

UploadForm code:
---------------
public final class UploadForm extends ActionForm
{
private FormFile file;
public FormFile getFile() { return file;}
public void setFile(FormFile file) {this.file = file;}
}

UploadAction:perform() code:
----------------------------
public
ActionForward perform(ActionMapping mapping,
     ActionForm form, HttpServletRequest request, HttpServletResponse
response)
throws IOException, ServletException
{
    UploadForm fileForm = (UploadForm) form;    <== form is coming null
    FormFile file = fileForm.getFile();
        .........
}


Any help will be appreciated.

juan

Reply via email to