Skip to Content
Former Member
Sep 18, 2017 at 03:53 PM

Issue With

1330 Views Last edit Sep 18, 2017 at 04:08 PM 2 rev

Hello Developers,

We have an issue with Chrome & UI5's function. We have a model with some string data we want to download. The User clicks a button and we fire an event, which uses the function to download the file locally.

The problem is when a user has the option in Chrome which asks the user where to save files set to true, and the user clicks cancel, we have already executed our function which saves the file. All the usage of is in the onPress of the button and as such we currently have no way of knowing if the User clicked cancel in the Chrome popup asking for the save file location.

I understand this is not an issue with UI5 persay but has anyone any ideas on how to approach this or already solved this same issue?

Please if you need any more information or some useful material, dont hesitate to post it.

Our on press currently looks something like this :

onDownloadPress : function(oEvent){
   //Create var With String Data From Model Attribute
   var sFileContent = this.getModel("sModelName").getObject("sFileContent");
   //User UI5 funciton to create local file., sFileName, sFileType, null, null);

Just to clarify the current problem we expierence, when cancel is selected, the is called but the path (Where the file should be saved locally) is empty.