1

I am trying to use uploadifive/uploadify to upload multiple files to a website. UploadiFive/Uploadify works, but it calls my controller multiple times. Once for each file uploaded. how could I change Uploadify/Uploadifive, so that it only calls the controller once with an array of the files uploaded.

I have this in my html view:

<div id="uploads"></div>
<input type="file" name="file_upload[]" id="file_upload" multiple/><br />
<a href="javascript:$('#file_upload').uploadifive('upload')">Upload Files</a>

And here's my jQuery-code:

 $(document).ready(function () {        
  $('#file_upload').uploadifive({
     'formData': { 'Id': $("input[name='Id']").val()},
     'queueSizeLimit': 10,
     //'queueID':'uploads',
     'fileObjName': 'file',
     'method': 'post',
     'auto': false,
     'multi':true,
     'buttonText': 'Upload Files',
     'dnd': false,
     'simuploadLimit': 10,
     'uploadScript': '/Project/UploadDoc',
     'onUploadComplete': function (file, data) {
         console.log(data);
     },
     'onFallback': function () {
         alert('HTML5 is not supported in this browser.');
     },
     'onClearQueue': function (queueItemCount) {
         alert(queueItemCount + ' file(s) were removed from the queue');
     },
     'onQueueComplete': function (queueData) {
      //   alert(queueData.uploadsSuccessful + ' files were successfully uploaded.');
       //  $('#file_upload').uploadifyCancel('*');
     },
       'onDestroy' : function() {
           alert('I am getting destroyed!');
     }  
  });        
});

Note I'm using MVC3 c# entity framework, the latest uploadify/Uploadifive and Javascript is up to the most recent version.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.