Older browsers, such as IE6, allow only two socket connections to the server. So, if one socket is currently being used to upload the file, then only one remains for other interactions. If server push is being used, then that would involve the second socket being used for a blocking connection, leaving none for obtaining progress information. As such, progress should be implemented via server push, instead of on it's own.
The basic building blocks of the solution are as follows:
1. Server side preparation before upload
On the server side, a resource for the progress information will be registered in either request or session scope. As well, a push id will be created. When the fileEntry component renders itself, it will send the URL of the resource and the push id to the browser.
2. Client side work immediately before submit / upload
The fileEntry javascript will register the push id with the bridge, giving a function callback, which will respond to progress push notifications.
3. Server side work during upload, for progress notification
When there is sufficient progress, and some amount of time has passed since the last progress notification, the resource contents will be updated with the new progress information, and a push notification will be given.
4. Client side work during upload, in progress notifications
When there is progress, the javascript progress function will use the XMLHttpRequest to access the resource. The resource may contain a JSON data structure with the progress information for all of the files, as well as the total progress, if possible. Potentially the success/failure messages will be included as well. The user interface will be updated with this data.
There will be a race condition, if the resource is in request scope, where the request will have finished, and the response will be transmitted to the browser, and in-between the browser may respond to push notifications, where the resource is no longer available. The client code should gracefully accept this, and do nothing.
5. Server side work after upload
When rendering the fileEntry component after the uploads have completed, it should render the same UI that the progresses rendered, but with everything completed. And the registered resource should be set to depict everything as completed as well.
6. Client side work after upload
When the component javascript gets the iframe updates after the upload, it should de-register itself from push notifications, so that the bridge may cease maintaining a blocking connection, if the fileEntry upload operation was the sole use of it.
Older browsers, such as IE6, allow only two socket connections to the server. So, if one socket is currently being used to upload the file, then only one remains for other interactions. If server push is being used, then that would involve the second socket being used for a blocking connection, leaving none for obtaining progress information. As such, progress should be implemented via server push, instead of on it's own.
The basic building blocks of the solution are as follows:
1. Server side preparation before upload
On the server side, a resource for the progress information will be registered in either request or session scope. As well, a push id will be created. When the fileEntry component renders itself, it will send the URL of the resource and the push id to the browser.
2. Client side work immediately before submit / upload
The fileEntry javascript will register the push id with the bridge, giving a function callback, which will respond to progress push notifications.
3. Server side work during upload, for progress notification
When there is sufficient progress, and some amount of time has passed since the last progress notification, the resource contents will be updated with the new progress information, and a push notification will be given.
4. Client side work during upload, in progress notifications
When there is progress, the javascript progress function will use the XMLHttpRequest to access the resource. The resource may contain a JSON data structure with the progress information for all of the files, as well as the total progress, if possible. Potentially the success/failure messages will be included as well. The user interface will be updated with this data.
There will be a race condition, if the resource is in request scope, where the request will have finished, and the response will be transmitted to the browser, and in-between the browser may respond to push notifications, where the resource is no longer available. The client code should gracefully accept this, and do nothing.
5. Server side work after upload
When rendering the fileEntry component after the uploads have completed, it should render the same UI that the progresses rendered, but with everything completed. And the registered resource should be set to depict everything as completed as well.
6. Client side work after upload
When the component javascript gets the iframe updates after the upload, it should de-register itself from push notifications, so that the bridge may cease maintaining a blocking connection, if the fileEntry upload operation was the sole use of it.