file-html5.js revision 7211944935145abdba8a3ea3b17621ec264d8e21
/**
* The FileHTML5 class provides a wrapper for a file pointer in an HTML5 The File wrapper
* also implements the mechanics for uploading a file and tracking its progress.
* @module file-html5
*/
/**
* The class provides a wrapper for a file pointer.
* @class FileHTML5
* @extends Base
* @constructor
*/
var FileHTML5 = function(o) {
var file = null;
if (FileHTML5.isValidFile(o)) {
file = o;
}
}
else {
file = false;
}
if (!this.get("file")) {
}
if (!this.get("html5")) {
this._set("html5", true);
}
if (!this.get("name")) {
}
}
if (!this.get("type")) {
}
}
}
};
initializer : function (cfg) {
if (!this.get("id")) {
}
},
_uploadEventHandler: function (event) {
case "progress":
});
break;
case "load":
this._set("xhr", null);
break;
case "error":
break;
case "abort":
break;
case "readystatechange":
originEvent: event});
break;
}
},
/**
* Starts the upload of a specific file.
*
* @method startUpload
* @param url {String} The URL to upload the file to.
* @param parameters {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* @param fileFieldName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)
* @return {Boolean} This method always returns true.
*/
var uploadData = new FormData(),
},
/**
* Cancels the upload of a specific file, if currently in progress.
*
* @method cancelUpload
*/
cancelUpload: function () {
}
}, {
NAME: 'file',
TYPE: 'html5',
ATTRS: {
html5: {
readOnly: true,
value: false
},
id: {
writeOnce: "initOnly",
value: null
},
size: {
writeOnce: "initOnly",
value: 0
},
name: {
writeOnce: "initOnly",
value: null
},
dateCreated: {
writeOnce: "initOnly",
value: null
},
dateModified: {
writeOnce: "initOnly",
value: null
},
readOnly: true,
value: 0
},
type: {
writeOnce: "initOnly",
value: null
},
file: {
writeOnce: "initOnly",
value: null
},
uploader: {
writeOnce: "initOnly",
value: null
},
xhr: {
readOnly: true,
value: null
},
readOnly: true,
value: null
}
},
/**
* Checks whether a specific native file instance is valid
*
* @method isValidFile
* @param file {File} A native File() instance.
*/
isValidFile: function (file) {
},
/**
* Checks whether the browser has a native upload capability
* via XMLHttpRequest Level 2.
*
* @method canUpload
*/
canUpload: function () {
}
});