V2 issues

Nov 8, 2008 at 11:18 PM
Thanks for releasing V2 of both uploaders.  I downloaded both projects and I migrated my code from previous version to the new one.  I have the following code in my test web page:






<fjx:FileUploader ID="FileUploader1" runat="server">










(bar, percDiv, percentage, progress, loadedBytes, currentFileLoadedBytes){





bar.style.width =


((progress == 0 || progress == 1) ? 0 : (progress * this.getProgressBarWidth()))+"px";







percDiv.innerHTML = (progress == 0 || progress == 1) ? "":(percentage + "%");




if(percentage == 100) {

















<br />



<br />



<br />



<fjx:FileUploader ID="FileUploader2" runat="server"></fjx:FileUploader>




I'm getting the following error when compiling:

Error 1 Type 'com.flajaxian.FileUploader' does not have a public property named 'ProgressBarChangeJsFunction'. C:\webapps\FlajaxianTestAjaxV2\Default.aspx 74 

Error 3 Cannot switch views: Content is not allowed between the opening and closing tags for element 'FileUploader'. C:\webapps\FlajaxianTestAjaxV2\Default.aspx 77 14 C:\webapps\FlajaxianTestAjaxV2\

Is there a similar function available to 'ProgressBarChangeJsFunction'?

Also it doesn't seem like I can include anything between the <FileUploader> tags, or am I doing something wrong?


Nov 8, 2008 at 11:26 PM
Hi maratg,

Version 2.0 does not use inline functions. The UI must be flash because player 10 has restriction not to allow browse dialog unless it is triggered by user action on flash object.

The documentation of how to customize 2.0 is coming in a few days. For now I can just tell you not to use ...JsFunction templates
Nov 9, 2008 at 5:37 PM
Those inline JsFunctions were very useful.  We're using ajax to call a webservice.  And we were using the inline JsFunctions to initiate the upload routine.  Hopefully you'll have something similar available in this new version. Thanks.
Nov 10, 2008 at 1:39 AM
Are you going to add a client side event that will fire when the file is finished uploading in Version 2?

Are we going to be able to call the upload button using script like this: "document.getElementById("FileUploader2_UploadButton").firstChild.click();" ?

Nov 10, 2008 at 4:10 AM
Edited Nov 10, 2008 at 4:12 AM

So in the latest version to trigger upload you can call

The client side event is as follows:


function FileStateChanged(uploader, file, httpStatus, isLast){ 
      Flajaxian.fileStateChanged(uploader, file, httpStatus, isLast);
      var t = Flajaxian.$("traceTextArea"); // text area to see the result with ID="traceTextArea" 
        if(file.state > Flajaxian.File_Uploading){
                       t.value +=
"bytes:"+file.bytes+" name:"+file.name+" state:"+file.state+
                       " httpStatus:"+httpStatus+" isLast:"+isLast+"\n";
                      // state Selected = 1; Uploading = 2; Uploaded = 3; Cancelled = 4; Error = 5;
                      // here you can call uploader.cancel();





fjx:FileUploader ID="FileUploader1" JsFunc_FileStateChanged="FileStateChanged" runat="server">






Nov 11, 2008 at 6:29 AM
I've tried using the following code:



and i'm getting this error:  Microsoft JScript runtime error: Object doesn't support this property or method

here is my file uploader html code:  



fjx:FileUploader ID="FileUploader1" JsFunc_FileStateChanged="FileStateChanged" runat="server" />


Nov 11, 2008 at 7:21 AM
Nevermind, I didn't have the latest update of your code.  It works now.

Thanks a lot
Nov 11, 2008 at 8:34 AM
No problem and remember that the right code is 


and not