Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
WebUpload postback after multiple files uploaded
posted

Hello.

I'm using WebUpload (v14.1 20141.2011) control in the following configuration:

<igjq:WebUpload ID="WebUpload" runat="server" LabelAddButton="Вложить" LabelSummaryProgressButtonContinue="Загрузить"
                                                LabelUploadButton="Выбрать файлы для вложения в сообщение ..." Mode="Multiple" AutoStartUpload="true"
                                                MultipleFiles="True" OnUploadFinishing="WebUpload_UploadFinishing">
                                                <ClientEvents FileUploaded="onFileUploaded" ></ClientEvents>
</igjq:WebUpload>

(the text is in russian, don't be afraid).

The goal is to upload several files and then update page with the list of files, so i'm using client-side "FileUploaded" event to do a postback:

function onFileUploaded() {
        window.__doPostBack('WebUpload1_FileUploaded', 0);        
    }

According to the documentation (http://help.infragistics.com/Help/Doc/ASPNET/2012.2/CLR4.0/html/WebUpload_Using_Client_Side_Events.html) this event is fired once after all the files are uploaded. But now i can see that it's actually fired after each file is finished uploading. The postback after the first file uploaded obviously breaks the uploading process for the other files.

Is that a bug? Is the any other way to do a postback after all the files are uploaded?

Parents
  • 18204
    Offline posted

    Hi Anton Evseev,

     

    Thank you for posting in our forums!

    The file uploads are handled through their own HTTP handler and that fires the FileUploaded event on each individual upload.

    I am going to bring up the wording of that event in our documentation to our product guidance team to see about changing it to be more clear.

    To postback when all uploads have completed, you will need to track how many downloads have completed on the client side.  The number of uploads can be set when the fileUploading event is fired and a counter is incremented when each fileUploaded client event fires.  You can then check if the number of files uploaded matches the amount that were queued to upload and then cause the postback.  Please see the attached sample that demonstrates how this can be achieved.

    In my sample, before you can run it, you will need to import your "ig_ui" folder for the version of NetAdvantage you have installed on your machine to get the styling and scripts working.

    If you have any questions with this, please let me know.

    WU_UpdatePageOnUpload.zip
Reply Children
No Data