Advertisement
zalazdi

Untitled

Jan 24th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1.   $(document).ready(function() {
  2.     $('#newCaseForm').fileupload({
  3.       url: 'https://qa-cm.cloud.akzonobel.global/cases/25',
  4.       type: 'POST',
  5.       uploadTemplateId: 'case-attachment-template-upload',
  6.       downloadTemplateId: 'case-attachment-template-download',
  7.       maxNumberOfFiles: 10,
  8.       singleFileUploads: true,
  9.       autoUpload: false,
  10.       add: function (e, data) {
  11.           if (e.isDefaultPrevented()) {
  12.               return false;
  13.           }
  14.           var $this = $(this),
  15.               that = $this.data('blueimp-fileupload') ||
  16.                   $this.data('fileupload'),
  17.               options = that.options;
  18.           data.context = that._renderUpload(data.files)
  19.               .data('data', data)
  20.               .addClass('processing');
  21.           options.filesContainer[
  22.               options.prependFiles ? 'prepend' : 'append'
  23.               ](data.context);
  24.           that._forceReflow(data.context);
  25.           that._transition(data.context);
  26.  
  27.           console.log(data);
  28.  
  29.           $('#submitCaseFiles').click(function() {
  30.               data.submit();
  31.           });
  32.       },
  33.       beforeSend: function(oXhr) {
  34.           oXhr.setRequestHeader('dirty-hack-jwt-token', sJwtToken);
  35.       },
  36.       send: function (e, data) {
  37.         console.log('Send');
  38.         console.log(e);
  39.         console.log(data);
  40.       }
  41.     });
  42.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement