Skip to Content

Need to upload excle file when excel file is closed. If Excel file is Opened its should not allowed

Hello Friends,

I am reading the data from excel using "FileUploader". its working fine. Now my requirement is if excel file is opened it should not allowed. when excel file is closed then only its will allowed. how to do this

<Label id="fileNameId" text="File Upload" required="true"/>
                            
<u:FileUploader id="fileUploader" name="FILENAME" placeholder="Upload your file to the SAP System" 
                                    change="processFile" sameFilenameAllowed="false" liveChange="onSelectInput" width="350px"/>

Regards

Vijay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 20, 2020 at 03:18 PM

    Hi Zun,

    Good day.

    PFB Steps which is i implemented during that time.

    1) Import "xlsx.js" into project and add that in manifest.json under resource.PFB screen shot for your reference.

    2) Go to corresponding controller.js and View add below code.

    View Code:
    <Label id="fileNameId" text="File Upload" required="true"/>
    <u:FileUploader id="fileUploader" name="FILENAME" placeholder="Upload your file to the SAP System" change="processFile" sameFilenameAllowed="false" liveChange="onSelectInput" width="350px"/>
    
    Controller.JS
    
    /*global location */
    var tableModel; 
    var X = XLSX; 
    var view; 
    var excelFileDatatable; 
    var oExcelLineItems = []; 
    var XW = { 
             /* worker message */ 
             msg: 'xlsx', 
            /* worker scripts */ 
            rABS: './xlsxworker2.js', 
            norABS: './xlsxworker1.js', 
            noxfer: './xlsxworker.js' 
    };
    
    You can write the "processFile" method code. PFA document.
    export-excel-code.txt
    
    

    Hope this should be help full for you.

    Best Regards

    Vijay


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.