LPology / Simple-Ajax-Uploader

Javascript file upload plugin with progress bar support. Works in all major browsers, including IE7+, Chrome, Firefox, Safari, and Opera. No dependencies - use it with or without jQuery.
995 stars 267 forks source link

After uploading multiple images, only one image shows on result #85

Open alex-petrea opened 9 years ago

alex-petrea commented 9 years ago

All the images are uploaded and all of them are returned but when I want to show the images that have been uploaded only one of them gets returned and looks like it's the same in your demo, any ideas? thanks

LPology commented 9 years ago

Can you share your code? Server code and JS, preferably.

wolfgang-dev commented 9 years ago

the same by me.. #######################

var uploader = new ss.SimpleUpload({ button: btn, url: 'file_upload.php', name: 'uploadfile', multiple: true, hoverClass: 'hover', focusClass: 'focus', responseType: 'json', startXHR: function() { progressOuter.style.display = 'block'; // make progress bar visible this.setProgressBar( progressBar ); }, onSubmit: function() { msgBox.innerHTML = ''; // empty the message box btn.innerHTML = 'Uploading...'; // change button text to "Uploading..." }, onComplete: function( filename, response ) { btn.innerHTML = 'Choose Another File'; progressOuter.style.display = 'none'; // hide progress bar when upload is completed

        if ( !response ) {
            msgBox.innerHTML = 'Unable to upload file';
            return;
        }

        if ( response.success === true ) {
            msgBox.innerHTML = '<strong>' + escapeTags( filename ) + '</strong>' + ' successfully uploaded.';

        } else {
            if ( response.msg )  {
                msgBox.innerHTML = escapeTags( response.msg );

            } else {
                msgBox.innerHTML = 'An error occurred and the upload failed.';
            }
        }
      },
    onError: function() {
        progressOuter.style.display = 'none';
        msgBox.innerHTML = 'Unable to upload file';
      }
});