@@ -539,20 +539,11 @@ jQuery(document).ready(function() {
539
539
540
540
function createUploadWindow ( ) {
541
541
542
-
543
542
var pom = document . createElement ( 'input' ) ;
544
543
pom . setAttribute ( 'id' , 'uploadFile' ) ;
545
544
pom . setAttribute ( 'type' , 'file' ) ;
546
545
pom . setAttribute ( 'name' , 'upFile' ) ;
547
-
548
- // Internet Explorer adaptation
549
- pom . setAttribute ( 'onchange' , "function uploadFinished() {" +
550
- "var subscriptionFile = pom.files[0];" +
551
- "console.log('Uploaded File: ' + subscriptionFile);" +
552
- "validateJsonandSubscriptionFormat(subscriptionFile);" +
553
- "};" ) ;
554
-
555
- // All other Web Browser
546
+
556
547
pom . onchange = function uploadFinished ( ) {
557
548
var subscriptionFile = pom . files [ 0 ] ;
558
549
validateJsonAndCreateSubscriptions ( subscriptionFile ) ;
@@ -567,9 +558,22 @@ jQuery(document).ready(function() {
567
558
pom . click ( ) ;
568
559
}
569
560
}
570
-
571
- createUploadWindow ( ) ;
572
-
561
+
562
+ function createUploadWindowMSExplorer ( ) {
563
+
564
+ $ ( '#upload_subscription_file' ) . click ( ) ;
565
+ var file = $ ( '#upload_subscription_file' ) . prop ( 'files' ) [ 0 ] ;
566
+ validateJsonAndCreateSubscriptions ( file ) ;
567
+ }
568
+
569
+ // If MS Internet Explorer -> special handling for creating download file window.
570
+ if ( window . navigator . msSaveOrOpenBlob ) {
571
+ createUploadWindowMSExplorer ( ) ;
572
+ }
573
+ else {
574
+ // HTML5 Download File window handling
575
+ createUploadWindow ( ) ;
576
+ }
573
577
} ) ;
574
578
// /END ## upload_subscriptions #################################################
575
579
0 commit comments