FileUploadedJsFunc

Jan 16, 2009 at 6:47 PM
Howzit bru!

First off - FANTASTIC component! Super stoked with it so far! well done!

Other than that - I'm having a problem getting the fileUploadJSFunc to work - no matter what I do it never seems to fire?

Below is my code to date (I've stripped out the guts of the FileReceived function as they're not important here - and I've also taken out the fileUploadJSFunc function as it was never firing)


 

<fjx:FileUploader OnFileReceived="FileReceived" MaxFileSize="2MB" MaxFileSizeReachedMessage="No files bigger than {0} are allowed" ID="FileUploader2" AllowedFileTypes="Web Images (Jpeg, Gig, Png):*.jpg;*.jpeg;*.png;*.gif" runat="server" >

 

 

<Adapters>

 

 

<fjx:FileSaverAdapter Runat="server" FolderName="../I/Uploads" />

 

 

</Adapters>

 

 

</fjx:FileUploader>

 

 

<script runat="server">

 

 

protected void FileReceived(Object sender, FileReceivedEventArgs e)
{

 

    // some or other update logic

}

 

</script>

 



Basically I just want a function to fire after all of the files have been uploaded - essentially to display a "your upload is complete" message

I have download the latest binary - but it didn't seem to do anything

Any help would be great!

Cheers and keep up the good work!

Coordinator
Jan 16, 2009 at 7:16 PM
http://flajaxian.com/flajaxian.com/FileUploader2.0Help.html#HowToUseClientSideEvents

<script>
function FileStateChanged(uploader, file, httpStatus, isLast){
    Flajaxian.fileStateChanged(uploader, file, httpStatus, isLast);
    var t = Flajaxian.$("MyDiv");
    if(file.state > Flajaxian.File_Uploading){
        t.innerHTML += "The file name:"+file.name+" has been uploaded</br>";
    }
}
</script>
<div id="MyDiv"></div>
<fjx:FileUploader JsFunc_FileStateChanged="FileStateChanged" runat="server" >
    <Adapters>
        <fjx:FileSaverAdapter Runat="server" FolderName="UploadFolder" />
    </Adapters>
</fjx:FileUploader>