Upload Control Event onAllComplete

Sep 22, 2008 at 4:46 PM
I'm seeing a problem that when calling the onAllComplete event

When using the control like this:

<
piece:Upload ID="Upload1" runat="server" InstantStart="false" Trigger="btnUpload" AllowDuplicates="false" EnableMultipleSelection="true" OnFileReceived="upload_FileReceived"/>

I am able to select multiple files and upload them as expected.

But once I add the OnAllComplete event to the mix, the control reverts about to single file select and stop functioning as well (will not upload the one file it allows you to select)

Has anyone else seen this issue?

 

<

piece:Upload ID="Upload1" runat="server" InstantStart="false" Trigger="btnUpload" AllowDuplicates="false" EnableMultipleSelection="true" OnFileReceived="upload_FileReceived" OnAllComplete="upload_AllComplete"/>

There are several things I would like to accomplish once all files have been uploaded and the OnAllcomplete event seems like the best choice.

Is this a bug or am I simple not using the control properly?

Also, how do you clear the file list queue from code?

Thanks,
-dave

 

Coordinator
Sep 23, 2008 at 1:42 PM
Hi. Here's a solution to both questions:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <script type="text/javascript">
        function onAllComplete()
        {
            this.clearList();
        }
    </script>

    Select the files you wish to upload and click 'Upload Selected Files' when ready.

    <div>
        <piece:Upload
            Runat="server"
            ID="fancyUpload"
            OnFileReceived="upload_FileReceived"
            InstantStart="False"
            BrowseText="Select Files"
            OnAllComplete="onAllComplete"
            Trigger="Button1" />
    </div>

    <div style="width: 500px; clear: both;">
        <ul class="photoupload-queue" id="photoupload-queue" />
    </div>

    <div>
        <asp:Button ID="Button1" runat="server" Text="Upload Selected Files" />
    </div>


</asp:Content>