as I have said, you need to do extra work to save your upload data to your
designated server file.

Here is an example

   ImportForm theForm = (ImportForm) form;

   FormFile file = theForm.getTheFile();
   String fileName= file.getFileName();
   String encoding = theForm.getEncoding();
   String separator  = theForm.getSeparator();
   String memberType = theForm.getMemberType();

   InputStream inputStream = file.getInputStream();
   Charset charset = Charset.forName(encoding);
   BufferedReader reader = new BufferedReader( new
InputStreamReader(inputStream, charset) );

  // do your save here

-D

----- Original Message ----- 
From: "Daniel Massie" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 06, 2003 8:57 AM
Subject: RE: uploadfile path


> thats exactly what has happened to me, and if i cant cast to DiskFile
there
> isn't much information i can retrieve
>
> -----Original Message-----
> From: Yansheng Lin [mailto:[EMAIL PROTECTED]
> Sent: 06 August 2003 16:41
> To: 'Struts Users Mailing List'
> Subject: RE: uploadfile path
>
>
> I had a problem using DiskFile when upgrading to 1.1 though.  Somehow you
> cannot
> convert/cast a FormFile to DiskFile anymore...  I think there was a post
to
> dev
> list about this too.  It brings down your production code!!!
>
> -----Original Message-----
> From: Alok Tijoriwala [mailto:[EMAIL PROTECTED]
> Sent: August 6, 2003 9:33 AM
> To: Struts Users Mailing List
> Subject: Re: uploadfile path
>
>
> Hi Danielle,
>
> You will have to use the DiskFile class which
> implements the FormFile interface.
>  In the struts-config.xml , your controller
> configuration should be as under:
> <controller
> processorClass="com.abnamro.waf.struts.WAFRequestProcessor"
> tempDir="/upload" maxFileSize="10K"
> multipartClass="org.apache.struts.upload.DiskMultipartRequestHandler">
> <set-property property="inputForward" value="true"/>
> </controller>
>
> Regards
> Alok
> --- Dan Tran <[EMAIL PROTECTED]> wrote:
> > Folow the Struts upload example, you can trace thru
> > how Struts gets the
> > client file and upload to server where you have to
> > do extra work to copy
> > data from FormFile (its stream buffer)  to the your
> > choice of server
> > location.
> >
> > -Dan
> >
> > ----- Original Message -----
> > From: "Yansheng Lin" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'"
> > <[EMAIL PROTECTED]>
> > Sent: Wednesday, August 06, 2003 8:18 AM
> > Subject: RE: uploadfile path
> >
> >
> > >     <html:form method="POST"
> > enctype="multipart/form-data">
> > >         <html:file property="theFile" />
> > >     </html:form>
> > >
> > > theFile is type of FormFile.  You can go from
> > there.
> > >
> > > -----Original Message-----
> > > From: Daniel Massie
> > [mailto:[EMAIL PROTECTED]
> > > Sent: August 6, 2003 2:35 AM
> > > To: Struts Users Mailing List
> > > Subject: uploadfile path
> > >
> > >
> > > I am trying to upload a file using html:file which
> > is received as a
> > > FormFile, the problem is I need to find out this
> > files absolute path. Hwo
> > > can I retrieve this information?
> > >
> > > Thanks
> > > Daniel
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to