Additional Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
yaron_ganor
Product and Topic Expert
Product and Topic Expert
0 Kudos
750

Finally managed to get that FileUploader to work.

Seems that the API you get at RT is not the same as what is published...

Anyway, I couldn’t use the onTypeMissmatch API so I had to write a work around:

     importSite: function importSite() {

            var fileExtension = this.fileUploader.getProperty("value").toString();

            var fileNameLength = fileExtension.length;

//            verify the file extension before posting to the server - work around for the onTypeMissmatch api

            if (fileExtension.substring(fileNameLength-3,fileNameLength) !== "zip"){

                this.showError("Only zip files are supported"));

            } else{

              

                this.fileUploader.upload();

            }

        },

I know this is not really a proper file type validation, but I had to start with something...

Wish these things were a little more straight forward 🙂

I also put it on snipix.

byg