Re: WOFileUpload and WOLongResponsePage
Re: WOFileUpload and WOLongResponsePage
- Subject: Re: WOFileUpload and WOLongResponsePage
- From: Chuck Hill <email@hidden>
- Date: Wed, 27 Sep 2006 15:57:58 -0700
Mostly wild guesses...
On Sep 27, 2006, at 3:09 PM, David Holt wrote:
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??).
Of the input or output stream that you bind to the WOFileUpload, I
think. I don't really see why this would be needed if (3) above works.
2) Where do I call his code in order to get the total length of the
WOInputStreamData?
In the page that the upload is submitted to. isd then gets passed to
the status page.
3) I am using the size() method on the ByteArrayOutputStream to
track the status for the WOLongResponsePage. Is this correct?
I am not sure. It seems like it might be OK.
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
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