Rafal Krzewski <[EMAIL PROTECTED]> wrote:
[SNIP]
I very much agree with your reasons for pursuing this... ;)
> 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.
Question: We would then be responsible for reading the input stream and
writing to the physical disk, or this would already be done for us and the
FileItem.getStream() method would return a stream to the file on disk ( or in
memory )?
What we are doing is determining where the files go physically when uploaded.
We create a directory and place the files in the new directory in some cases,
others we use an existing directory, etc. How would we accomplish this with
your proposed system. With the oreilly uploader, we just configure the upload
path, instaniate the uploader, and let it put the file there.
> file.upload.automatic - wether multipart/form-data request should be
parsed by ParameterParser or
> left intact for Action to process
>
> file.upload.storage - a temporary directory for the uploaded files
>
> file.upload.size.max - largest POST request that is accepted by the auto
upload
>
> file.upload.size.cache - largest POST request which elemets will be stored
in memory intead of disk
>
> Caching / temporary storage management is happening behind the scenes (eg.
FileItem deletes it's temporary
> storage file inside finalize()). All turbine instances can use single
temporary directory for uploading files
> (needs turbine.instance.id patch, see my other posting today)
So, to answer my question, we'd have all uploaded files going to the same
directory? What if two users upload the same filename?
> There is another 'bonus' feature in the code I wrote - I followed RFC 1867
(http://rf.cx/rfc1867.html),
> and implemented sending multiple files from single file input html element.
No browsers in existence support
> this, but someone could write an Applet that makes HTTP POST requests to
Turbine and sends multiple files
> at once. Cool, isn't it?
Yes, it is! Just what we needed here! I'll attempt to be as much help as
possible....
jb
Jeff Brekke
mailto:[EMAIL PROTECTED]
http://sites.netscape.net/ekkerbj
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at
http://home.netscape.com/webmail
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]