DWR

File upload: support for progress bar(s)

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Normal Normal
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 4.0
  • Component/s: File Upload/Download
  • Description:
    Hide
    Usage:

    either:
       function uploadFiles() {
            RemoteClass.uploadFiles(dwr.util.getValue("file1"), dwr.util.getValue("file2"), { fileProgress: true });
       }

    or:
       function uploadFiles() {
        dwr.engine.setFileProgress(true);
            RemoteClass.uploadFiles(dwr.util.getValue("file1"), dwr.util.getValue("file2"));
       }

    Changes Required:
    1. client: Display the progress bar using logic similar to useLoadingImage() described here http://getahead.org/dwr/browser/util/useloadingmessage
    2. server: Change org.directwebremoting.dwrp.ParseUtil to sends the status back to the browser using reverse ajax for each file being uploaded.
    3. client: Use the status to update the progress bar.

    Suggestied Solution:
    1. Three new functions required in engine.js:
       showFileProgressBars(): hides file inputs and displays progress bars in their place, gives each progress bar an id
       updateFileProgressBar(id, percentage): updates a status bar with the upload percentage
       hideFileProgressBars(): display the file inputs in place of the progress bars

    2. org.directwebremoting.dwrp.ParseUtil should set a progress listener on SERVLET_FILE_UPLOAD.
    Show
    Usage: either:    function uploadFiles() {         RemoteClass.uploadFiles(dwr.util.getValue("file1"), dwr.util.getValue("file2"), { fileProgress: true });    } or:    function uploadFiles() {     dwr.engine.setFileProgress(true);         RemoteClass.uploadFiles(dwr.util.getValue("file1"), dwr.util.getValue("file2"));    } Changes Required: 1. client: Display the progress bar using logic similar to useLoadingImage() described here http://getahead.org/dwr/browser/util/useloadingmessage 2. server: Change org.directwebremoting.dwrp.ParseUtil to sends the status back to the browser using reverse ajax for each file being uploaded. 3. client: Use the status to update the progress bar. Suggestied Solution: 1. Three new functions required in engine.js:    showFileProgressBars(): hides file inputs and displays progress bars in their place, gives each progress bar an id    updateFileProgressBar(id, percentage): updates a status bar with the upload percentage    hideFileProgressBars(): display the file inputs in place of the progress bars 2. org.directwebremoting.dwrp.ParseUtil should set a progress listener on SERVLET_FILE_UPLOAD.
  1. uploadProgress.html
    (1 kB)
    Lance Semmens
    10/Sep/07 5:27 PM

Activity

Lance Semmens made changes - 10/Sep/07 5:27 PM
Field Original Value New Value
Attachment uploadProgress.html [ 10068 ]
Joe Walker made changes - 08/Feb/08 4:24 AM
Fix Version/s 3.0.M1 [ 10042 ]
Joe Walker made changes - 29/Feb/08 10:13 AM
Fix Version/s 3.0.M1 [ 10042 ]
Fix Version/s 3.0.M2 [ 10051 ]
Joe Walker made changes - 30/Oct/08 4:00 PM
Fix Version/s 3.0.M2 [ 10051 ]
Fix Version/s 4.0 [ 10024 ]
Lance Semmens made changes - 27/May/09 12:00 PM
Assignee Joe Walker [ joe ] Lance Semmens [ lance ]
Lance Semmens made changes - 31/May/09 11:25 PM
Assignee Lance Semmens [ lance ] David Marginian [ davidmarginian ]
David Marginian made changes - 03/Jun/09 5:38 AM
Priority Major [ 3 ] Normal [ 6 ]
David Marginian made changes - 23/Jun/09 5:28 AM
Component/s File Upload/Download [ 10070 ]
Component/s engine [ 10002 ]
Component/s core [ 10001 ]
Assignee David Marginian [ davidmarginian ] Lance Semmens [ lance ]

People

Dates

  • Created:
    03/Sep/07 1:38 PM
    Updated:
    23/Jun/09 5:28 AM