Ajax method call on Ajax File Upload button

193 views Asked by At

I'm using ajax file upload to upload multiple files directly stored in my dropbox account without letting them to store on any local directory or folder. For that I'm using ajax call method. But somehow I'm not able to run that ajax call when i click on upload button to upload files.

Below is the code for uploading multiple files.

Upload.aspx

<script type="text/javascript">

                    function AjaxFileUploadEvent()
                    {
                    //$(document).ready(function () {
                        $("#<%=AjaxFileUpload1.ClientID %>").uploadify({
                            swf: 'scripts/uploadify.swf',
                            uploader: 'Upload.ashx',
                            cancelImg: 'Content/cancel.png',
                            auto: true,
                            multi: true,
                            method: 'POST',
                            //fileTypeExts: '*.jpg; *.png; *.gif; *.bmp; *.jpeg; *.JPG; *.pdf; *.doc; *.docx;',
                            buttonText: 'Upload File',
                            width: 130,
                            onUploadSuccess: function (file, data, response) {

                                var filName = file.name + Math.random();


                                $("#attachedfiles").append("<tr><td>" + file.name + "</td><td><a onclick=\"deleteHostTable(this);\"  href = 'javascript:;'>[x]</a></td></tr>");

                            },
                            onFallback: function () {
                                alert('Flash was not detected  or flash version is not supported.');

                            }
                        });
                    }

  </script>


<div>
                            <%--<asp:FileUpload ID="FileUpload1" runat="server" />
                            <table class="rounded_corners" id="attachedfiles">
                            </table>--%>
                        <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" OnUploadComplete="AjaxFileUploadEvent" />
                        </div>
0

There are 0 answers