On Tue, 19 Nov 2002, Dan Tran wrote:

> Martin, It is good to learn something new form you.
>
> However, as I look thru the default handler, the FormFile.getInputStream()
> returns a ByteArrayInputStream
> which somewhat equivalent to the strongly discouraged getFileData().  Any
> comment on this?

No, FormFile.getInputStream() returns an InputStream. See:

http://jakarta.apache.org/struts/doc-1.0.2/api/org/apache/struts/upload/FormFile.html#getInputStream()

What kind of input stream this is depends on the underlying
implementation. Struts 1.1 uses the Commons FileUpload package, by
default, and that package determines whether to store the uploaded part to
disk or not based on its size.

>
> Also, on the topic of DiskFile,  Others and I may just want to have access
> to the temp file and rename or move it
> to other location without paying for another round of copying.  I believe it
> is reasonable.

Again, you are assuming that there is a temp file. With the Commons
FileUpload implementation in Struts 1.1, even Struts does not know if
there is a temp file or not.

In a future version of both Commons FileUpload and Struts, it is possible
that we could add a method that allows specifying a File to write the
content to, using a file rename under the covers if possible. However, it
would have to be a future version of both packages, since it would require
an interface change in each.

Feel free to submit an enhancement request to Bugzilla if you'd like to
make sure we don't forget about this. ;-)

--
Martin Cooper


>
> -Dan
>
> ----- Original Message -----
> From: "Martin Cooper" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, November 19, 2002 12:02 PM
> Subject: Re: Access temporary files
>
>
> >
> >
> > On Tue, 19 Nov 2002, Dan Tran wrote:
> >
> > > Configure your controller, via Struts config, to have multipartClass set
> to
> > > org.apache.struts.upload.DiskMultipartRequestHandler
> >
> > If you are using Struts 1.1, I strongly recommend that you do *not* do
> > this. The default file upload handler in Struts 1.1 is much faster and
> > much more reliable than the DiskMultipartRequestHandler implementation,
> > which will be deprecated in Struts 1.1.
> >
> > --
> > Martin Cooper
> >
> >
> > >
> > > Hope this helps
> > >
> > > -D
> > >
> > > ----- Original Message -----
> > > From: "Bernhard Oberndorfer" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, November 19, 2002 12:57 AM
> > > Subject: Access temporary files
> > >
> > >
> > > > Hello
> > > >
> > > > Is there a way to access or to get the name of an temporary file which
> was
> > > > uploaded as FormFile(I use the <html:file> tag)?
> > > > DiskFile, which implements FormFile, for example provides a method
> > > > getFilePath() to get the temporary file path.
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to