Advertisement
lol2x

Untitled

Mar 8th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Data.prototype.send = function() {
  2.   'use strict';
  3.   var formData = new FormData();
  4.   formData.append('file', this.file, this.name);
  5.   if (this.property !== undefined) {
  6.     formData.append('property', this.property);
  7.   }
  8.   var request = new XMLHttpRequest();
  9.  
  10.   request.upload.addEventListener('progress', function(e) {
  11.     var pc = parseInt(100 - (e.loaded / e.total * 100));
  12.     //Co tutaj?
  13.   }, false);
  14.  
  15.   request.onreadystatechange = function(e) {
  16.     if (xhr.readyState == 4) {
  17.       //Co tutaj?
  18.     }
  19.   };
  20.   request.open('POST', upload.php, true);
  21.   request.send(formData);
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement