when the upload or download operation of all files has successfully completed?

Jun 18, 2008 at 6:38 AM
when the upload or download operation of all files has successfully completed? how to get the state in asp.net form
Coordinator
Jun 18, 2008 at 3:41 PM
You have to trigger it from client side. You can overrride ProgressBarChangeJsFunction
<fjx:FileUploader ID="FileUploader1" runat="server" >
    <Adapters>
        ...
    </Adapters>
    <ProgressBarChangeJsFunction><![CDATA[
function(bar, percDiv, percentage, progress, loadedBytes, currentFileLoadedBytes){
  if(!!bar){
    bar.style.width =
      ((progress == 0 || progress == 1) ? 0 : (progress * this.getProgressBarWidth()))+"px";
  }
  if(!!percDiv){
    percDiv.innerHTML = (progress == 0 || progress == 1) ? "":(percentage + "%");
  }
  if(progress == 1){
    // do what you want to do here
    // for example to redirect to google do: 
    //document.location.href = 'http://google.com';
  }
}
    ]]></ProgressBarChangeJsFunction>
</fjx:FileUploader>
Coordinator
Jun 18, 2008 at 4:32 PM

or

<fjx:FileUploader ID="FileUploader1" runat="server" >
    <Adapters>
        <fjx:FileSaverAdapter Runat="server" FolderName="UploadFolder" />
    </Adapters>
    <FileListInitTraverseJsFunction><![CDATA[
      function(box, files, currPerc){
        box.innerHTML = "";
        box.style.display = "none";
        var perc = parseInt(currPerc.innerHTML);
        if(perc >= 99){
          document.location.href = 'http://google.com';
        }
      }
    ]]></FileListInitTraverseJsFunction>
</fjx:FileUploader>

Sep 11, 2008 at 11:59 PM
1.Both solutions works but for the first solution in firefox caused 2 alerts when i place a alert('test').
2. the second solution works on the first try but try to upload again causes a javascript error in firefox only....
error below:

this.getFlash().CallFunction is not a function
this.getFlash().CallFunction("<invok...=\"javascript\"><arguments/></invoke>");


Coordinator
Sep 12, 2008 at 6:11 AM
OK this weekend I will add client side call backs for FileUploadFinished and FileQueueFinished.

Sorry, I am too busy today and tomorrow.
Coordinator
Sep 14, 2008 at 2:51 AM

There is now property FileUploadedJsFunc

<script language="JavaScript">
    function fileUploaded(obj){
        alert(
            obj.name+"|"+// File Name
            obj.size+"|"+// File Size - bytes
            obj.status+"|"+// File Status Uploaded = 3,Error = 5
            obj.index+"|"+// File Index
            obj.isLast // File is the last in the queue
        );
    }
</script>

<fjx:FileUploader ID="FileUploader1" FileUploadedJsFunc="fileUploaded" runat="server" >
    ...
</fjx:FileUploader>

Sep 17, 2008 at 11:35 PM
somehow i tried the new property, and seem to not work...? Im using also s3 parallel to the upload...
Coordinator
Sep 25, 2008 at 10:03 PM
Do you use the latest binary?
Oct 17, 2008 at 10:30 PM
The FileUploadJsFunc works fine for knowing when 1 file has been uploaded, but I need someway to know when all of the files have been uploaded.  How can I do this?

Thank you!
Coordinator
Oct 17, 2008 at 10:35 PM
Edited Oct 17, 2008 at 10:36 PM

<script language="JavaScript">
    function fileUploaded(obj){
       if(obj.isLast){
        alert(
            obj.name+"|"+// File Name
            obj.size+"|"+// File Size - bytes
            obj.status+"|"+// File Status Uploaded = 3,Error = 5
            obj.index+"|"+// File Index
            obj.isLast // File is the last in the queue
        );
       }
    }
</script>

<fjx:FileUploader ID="FileUploader1" FileUploadedJsFunc="fileUploaded" runat="server" >
    ...
</fjx:FileUploader>


Put your code instead of

alert(
            obj.name+"|"+// File Name
            obj.size+"|"+// File Size - bytes
            obj.status+"|"+// File Status Uploaded = 3,Error = 5
            obj.index+"|"+// File Index
            obj.isLast // File is the last in the queue
        );