Is there any alternative to the code below for attaching files in the google spreadhseet (depreciation error(UIapp))? : I must admit I cannot programme the solution I am seeking from scratch, usually I manipulate codes available for solving issues that I face regularly. The problem while running the code I was using "UiApp has been deprecated. Please use HtmlService instead.". I looked into Htmlservice documentation but did not get any idea how I could convert the entire UIapp code into functional html code. If someone has already solved file attachment problem due to deprecation(UIapp), then it would be a great help. Or, if anyone can suggest me anything that I can use as an alternative pls advise me. 

    // upload document into google spreadsheet
      // and put link to it into current cell
    
      function onOpen(e) {
        var ss = SpreadsheetApp.getActiveSpreadsheet()
        var menuEntries = [];
        menuEntries.push({name: "File...", functionName: "doGet"});
        ss.addMenu("Attach ...", menuEntries);
      }
    
      function doGet(e) {
        var app = UiApp.createApplication().setTitle("upload attachment into Google Drive");
        SpreadsheetApp.getActiveSpreadsheet().show(app);
        var form = app.createFormPanel().setId('frm').setEncoding('multipart/form-data');
        var formContent = app.createVerticalPanel();
        form.add(formContent);  
        formContent.add(app.createFileUpload().setName('thefile'));
    
        // these parameters need to be passed by form
        // in doPost() these cannot be found out anymore
        formContent.add(app.createHidden("activeCell", SpreadsheetApp.getActiveRange().getA1Notation()));
        formContent.add(app.createHidden("activeSheet", SpreadsheetApp.getActiveSheet().getName()));
        formContent.add(app.createHidden("activeSpreadsheet", SpreadsheetApp.getActiveSpreadsheet().getId()));
        formContent.add(app.createSubmitButton('Submit'));
        app.add(form);
        SpreadsheetApp.getActiveSpreadsheet().show(app);
        return HtmlService.createHtmlOutputFromFile('Index');
      }
    
      function doPost(e) {
        var app = UiApp.getActiveApplication();
        app.createLabel('saving...');
        var fileBlob = e.parameter.thefile;
    var doc = DriveApp.getFolderById('enterfolderId').createFile(fileBlob);
        var label = app.createLabel('file uploaded successfully');
    
        // write value into current cell
        var value = 'hyperlink("' + doc.getUrl() + '";"' + doc.getName() + '")'
        var activeSpreadsheet = e.parameter.activeSpreadsheet;
        var activeSheet = e.parameter.activeSheet;
        var activeCell = e.parameter.activeCell;
        var label = app.createLabel('file uploaded successfully');
        app.add(label);
        SpreadsheetApp.openById(activeSpreadsheet).getSheetByName(activeSheet).getRange(activeCell).setFormula(value);
        app.close();
        return app;
      }




