send the xlsx file to the backend api on button click event.

Hey team! I want to implement a functionality where I can send the current opened sheet as a xlsx file to my backend api so that it can read file (that it got from request.files) and perform operations on it.  It is something similar to when we upload a file in an uploader component and send it to backend api. In backend api we can get the file from the request.file. I wish to implement something similar. But here it should do it on just a button click. 


1 Reply

SP Sangeetha Priya Murugan Syncfusion Team September 14, 2023 01:52 PM UTC

Hi Srihari,


You can save the spreadsheet data as JSON/ Byte array/excel file into your database by using our openFromJson and saveAsJson methods. And we have already documented this requirement in our knowledge base site. Please refer the below links for more details.


Load and save Spreadsheet as Byte array in Data Base:


https://support.syncfusion.com/kb/article/10471/how-to-save-and-retrieve-javascript-spreadsheet-data-as-a-byte-array-in-the-database 


Load and save spreadsheet as JSON format in Data base:


https://support.syncfusion.com/kb/article/10357/save-and-retrieve-the-javascript-spreadsheet-data-as-json-in-database


Load and save spreadsheet as Excel file in the server.


https://support.syncfusion.com/kb/article/10474/how-to-open-and-save-an-excel-file-to-server-in-javascript-spreadsheet


To get the spreadsheet as blob data:


https://support.syncfusion.com/kb/article/11801/how-to-get-spreadsheet-blob-data-on-save-action                                                                                          


Please check the above details and get back to us, if you need any further assistance on this.


Loader.
Up arrow icon