Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
Upload field that is fully managed by JavaScript (no upload to a server)

I want to add an import functionality to a SAPUI5 application. I don't need to upload the file to a server, since I only want to handle the file on the client-side. The FileUploader control that is supplied with SAPUI5 doesn't seem to support that.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

One can disable the automatic upload by not setting the uploadOnChange property to true, and then adding a change handler to the control. The change handler has access to the uploaded files via oEvent.getParameters().files, and can process the uploaded files. When the form that is inside the FileUploader control is never submitted, it won't try to upload the files.

<mvc:View
    controllerName="app.controller.Main"
    xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:unified="sap.ui.unified"
    displayBlock="true">
    <Shell id="shell">
        <App id="app">
            <pages>
                <Page id="page" title="{i18n>title}">
                    <content>
                        <unified:FileUploader id="ui5-uploader"/>
                    </content>
                </Page>
            </pages>
        </App>
    </Shell>
</mvc:View>
sap.ui.define([
    "sap/ui/core/mvc/Controller"
], function (Controller) {
    "use strict";

    return Controller.extend("app.controller.Main", {
        onAfterRendering: function() {
            var uploader = this.getView().byId("ui5-uploader");
            uploader.attachChange(function(oEvent) {
                oEvent.getParameters().files[0].text().then(
                    function(sContent) {
                        console.log(sContent);
                    }
                );
            });
        }
        
    });
});
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda