WOFileUpload and WOLongResponsePage
WOFileUpload and WOLongResponsePage
- Subject: WOFileUpload and WOLongResponsePage
- From: David Holt <email@hidden>
- Date: Wed, 27 Sep 2006 15:09:11 -0700
Hi everyone,
I really hate asking this because it seems like it has been asked
frequently on the lists. I have been using Jonathan Rochkind's
solution for the past year or two, but I am no longer streaming to a
path on the file system, and it doesn't serve for uploading into the
database.
This was the closest I found to a solution posted by David Teran:
"1) give each Fileupload an additional 'name' binding, for example
'mySpecialFileUpload'
2) use either outputstream or inputstream binding for each
fileupload, use a subclass which keeps track how much was transferred
already
3) get total of one upload with
com.webobjects.appserver._private.WOInputStreamData isd =
(com.webobjects.appserver._private.WOInputStreamData)context().request
().formValueForKey("mySpecialFileUpload");
int length = isd.streamLength();
thats all, now with a little bit of javascript you can create a
autorefreshing page which gets the current status from a nice
directaction which 'knows' the input streams. This autorefreshing
page is opened when the user clicked 'submit' to upload the files and
is closed automatically when fileuploads are finished or cancelled."
I am using the outputStream binding for the WOFileUpload as he
suggested, and I have assigned a name binding to the WOFileUpload.
1) He said to use a sub-class to keep track of the transfer (sub-
class of what??).
2) Where do I call his code in order to get the total length of the
WOInputStreamData?
3) I am using the size() method on the ByteArrayOutputStream to track
the status for the WOLongResponsePage. Is this correct?
thanks,
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden