> -----Original Message-----
> From: Rafal Krzewski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 18, 2000 1:32 PM
> 
> I'm working on new automatic file uploader. I need file 
> upload for my project,
> so I started looking into the 
> util.upload.*/samples.actions.UploadFile as well
> as Neeme's FileHandler.
> The util.upload.* stuff depends on code that is available 
> along with one of
> O'Reily's books, and cannot be distributed with Turbine. This 
> is not good, 
> and we should think about writing free replacement for it, or 
> removing it.
> 
> Oleg and Neeme's FileHandler is working without any 
> additional code, but I must
> say I find it a bit awkward both in programing style, and in 
> functionality.

ok, I'm not 100% happy with the implementation neither but it works ;-)
If you write a better version, the better ;-)

> I have another idea of solving file uploading issues. 
> Consider the folowing class:
> 
> public class FileItem {
>    // ...
>    public String getFileName();
>    
>    public String getContentType();
> 
>    public long getLength();
> 
>    public boolean inMemory();         // gives a hint if the 
> file is cached or not
> 
>    public byte[] get();                       // returns the 
> contents of the file (and caches it if not yet cached)
> 
>    public InputStream getStream();    // returns a stream 
> that that can be used to read the file
> }
>
> Instances of such calss would be returned by 
> data.getParameters().getFileItem("fieldName"); for each file
> input in your form.

Cool!

Can we also get the temporary filename (or handle) of the file uploaded
(if stored on disk)? For example, I need to move the file to a different
location on the same machine and it would be much simpler to move it
instead of reading and writing the stream.

Otherwise, I'm looking forward to this new version ;-)

Neeme


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to