- // reference http://foundation.zurb.com/apps/docs/#!/angular-modules
- var config = {
- animationIn: 'slideInFromTop',
- contentScope: {
- accepted: accepted,
- refused: refused,
- appicon: appicon,
- appname: handle.basename
- }, template: tmplModal
- };
- // Popup Modal to render application data
- scope.modal = new ModalFactory(config);
- scope.modal.activate ();
+ if (isNaN(handle.file.size)) {
+ appicon = scope.isnotvalid;
+ template= tmplError;
+ }
+
+ } else {
+
+ var zipapp = new JSZip (upload.target.result);
+ var thumbnail = zipapp.file("icon_128.png");
+
+ // Check is we have a thumbnail within loaded Zipfile
+ if (!thumbnail) {
+ console.log ("This is not a valid Application Framework APP");
+ appicon = scope.isnotvalid;
+ template= tmplError;
+
+ } else {
+ //scope.imgElem[0].src = window.URL.createObjectURL(new Blob([thumbnail.asArrayBuffer()], {type: "image"}));
+ appicon = window.URL.createObjectURL(new Blob([thumbnail.asArrayBuffer()], {type: "image"}));
+ template = tmplModal;
+ }