Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Data.prototype.send = function() {
- 'use strict';
- var formData = new FormData();
- formData.append('file', this.file, this.name);
- if (this.property !== undefined) {
- formData.append('property', this.property);
- }
- var request = new XMLHttpRequest();
- request.upload.addEventListener('progress', function(e) {
- var pc = parseInt(100 - (e.loaded / e.total * 100));
- //Co tutaj?
- }, false);
- request.onreadystatechange = function(e) {
- if (xhr.readyState == 4) {
- //Co tutaj?
- }
- };
- request.open('POST', upload.php, true);
- request.send(formData);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement