after upload the image by using uploadify refresh the images

239 Views Asked by At

Actually i am trying to refresh the images when i upload the image by using Uploadify script.Image upload successfully but onUploadSuccess java script function not triggered although in my query.uploadify.js file

onUploadSuccess  // Triggered when a file is uploaded successfully

please can you help me.Thanks
My java Script is:

 $(function () {
                $("#file_upload").uploadify({
                    'swf': 'Resources/ImgUpload/uploadify.swf',
                    'uploader': 'VBHandler.ashx',
                    'cancelImg': 'Resources/ImgUpload/cancel.png',
                    'buttonText': 'Add Photos',
                    'fileDesc': 'Image Files',
                    'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
                    'multi': true,
                    'auto': true,
                    'formData': {
                        "id": "<%=HfID.Value%>",
                        'onUploadSuccess': function (file, data, response) {
                            // Load the swfupload settings
                            alert('upload');
                        }
                    }
                }); 

I am using version Uploadify v3.2

1

There are 1 best solutions below

1
Naqash Malik On BEST ANSWER

onUploadSuccess must not be in formData.So try this one:

 $(function () {
                $("#file_upload").uploadify({
                    'swf': 'Resources/ImgUpload/uploadify.swf',
                    'uploader': 'VBHandler.ashx',
                    'cancelImg': 'Resources/ImgUpload/cancel.png',
                    'buttonText': 'Add Photos',
                    'fileDesc': 'Image Files',
                    'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
                    'multi': true,
                    'auto': true,
                    'formData': {
                        "id": "<%=HfID.Value%>"
                    },
                    'onUploadSuccess': function (file, data, response) {
                            // Load the swfupload settings
                            alert('upload');
                    }
                });