* @param {Object} file
*/
"inspect" : true,
- /**
- * @event beforeupload
- * Fire before xhr upload the file
- * @param {Roo.dialog.UploadCropbox} this
- * @param {Object} data
- */
- "beforeupload" : true,
/**
* @event upload
* Fire when xhr upload the file
}
}
- height = 300;
+ height = 500;
width = Math.ceil(this.minWidth * height / this.minHeight);
if(this.minWidth > this.minHeight){
- width = 300;
+ width = 500;
height = Math.ceil(this.minHeight * width / this.minWidth);
}
var formData = new FormData();
- formData.append("onid", "43024");
- formData.append("ontable", "pressrelease_boilerplate");
-
formData.append('returnHTML', 'NO');
-
+
if(crop){
formData.append('crop', crop);
var blobBin = atob(crop.split(',')[1]);
for(var i = 0; i < blobBin.length; i++) {
array.push(blobBin.charCodeAt(i));
}
- var croppedFile =new Blob([new Uint8Array(array)], {type: 'image/png'});
+ var croppedFile =new Blob([new Uint8Array(array)], {type: this.cropType});
formData.append(this.paramName, croppedFile, file.name);
}
}
this.file = file;
- this.cropType = file.type;
+ if(typeof(file.type) != 'undefined' && file.type.length != 0) {
+ this.cropType = file.type;
+ }
var _this = this;