黄千龙
2023-03-08 962519811b7c4be07f30d09e791798b0ea79d3ae
force-app/main/default/aura/eSignAgencyPage/eSignAgencyPageHelper.js
@@ -799,7 +799,7 @@
    },
    MAX_FILE_SIZE: 4608000, //Max file size 4.5 MB
    CHUNK_SIZE: 750000, //Chunk Max size 750Kb
    CHUNK_SIZE: 750000, //Chunk Max size 750Kb //2023-03-07 zhj 之前是750000
    uploadHelper: function(component, event) {
        // start/show the loading spinner
        component.set("v.showLoadingSpinner", true);
@@ -807,6 +807,7 @@
        var fileInput = component.find("fileId").get("v.files");
        // get the first file using array index[0]
        var file = fileInput[0];
        console.log('file.size 开始 = ' + file.length);
        //var test = this.compress(file);
        var self = this;
        var pdf = file.type;
@@ -952,19 +953,20 @@
                    fileContents.length,
                    startPosition + this.CHUNK_SIZE
                );
                if (startPosition < endPosition) {
                    this.uploadInChunk(
                        component,
                        file,
                        fileContents,
                        startPosition,
                        endPosition,
                        ''
                    );
                }
                // if (startPosition < endPosition) {
                //     this.uploadInChunk(
                //         component,
                //         file,
                //         fileContents,
                //         startPosition,
                //         endPosition,
                //         ''
                //     );
                // }
                let staticResource = component.get('v.staticResource');
                var reader = new FileReader();
                reader.readAsDataURL(file.slice(0, endPosition));
                console.log('file.size 调用 = ' + file.length);
                reader.readAsDataURL(file);
                var that = this;
                reader.onloadend = function(evt){
                    if(evt.target.readyState == FileReader.DONE){
@@ -1117,19 +1119,19 @@
                fileContents.length,
                startPosition + this.CHUNK_SIZE
            );
            if (startPosition < endPosition) {
                this.uploadInChunk(
                    component,
                    file,
                    fileContents,
                    startPosition,
                    endPosition,
                    ''
                );
            }
            // if (startPosition < endPosition) {
            //     this.uploadInChunk(
            //         component,
            //         file,
            //         fileContents,
            //         startPosition,
            //         endPosition,
            //         ''
            //     );
            // }
            let staticResource = component.get('v.staticResource');
            var reader = new FileReader();
            reader.readAsDataURL(file.slice(0, endPosition));
            reader.readAsDataURL(file);
            var that = this;
            reader.onloadend = function(evt){
                if(evt.target.readyState == FileReader.DONE){