Hello, since our project has security concerns, we are using
allowOpen={true} openUrl="https://services.syncfusion.com/react/production/api/spreadsheet/open"
saveUrl="https://services.syncfusion.com/react/production/api/spreadsheet/save"
/>
openUrl and saveUrl
For SpreadSheet and other such similar components, we can import this api layer https://services.syncfusion.com/react/production/api/spreadsheet which is passed to openUrl and saveUrl. By making it our own service, we will ensure that the files stay inside.
We want to use this service on-prem for security reasons
Hi Mustafa,
We have done the Open/ Save (server side) functionality in ASP.NET. By using the Syncfusion XLSIO library, we have converted the Excel file to our supported JSON format on the server side. And load into the spreadsheet UI, and we haven’t made any copies of that loaded Excel file on our end.
And for demo purposes, we have published our web service for open/save action and mentioned it in our demo site. You can also use this demo url on your end, or else you can use a local service for the open/save action. And we have published our API services on GitHub; for more details, please refer to the below links.
Service sample Location: https://github.com/SyncfusionExamples/EJ2-Spreadsheet-WebServices/
https://ej2.syncfusion.com/react/documentation/spreadsheet/open-save
ASP.Net Core Web Service Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/WebAPI-218220683
To create the local web service, please refer to the below link.
https://www.syncfusion.com/kb/13200/how-to-remove-trial-version-tab-created-in-spreadsheet
If we misunderstood your requirement, please share a detailed explanation of your query with a video demonstration for better understanding.
Hi
Since we are using OpenURL and save URL from your services, does it effect our security? Is there any way to make our URL's to open and save
openUrl="https://services.syncfusion.com/react/production/api/spreadsheet/open"
saveUrl="https://services.syncfusion.com/react/production/api/spreadsheet/save"
Hi Laxmikanth Chougale,
We kindly inform you that your data will not be saved on our server while performing import and export actions in our Spreadsheet component.
Also, we would like to inform you that we have used hosted Syncfusion service URLs only for demo purpose only. Therefore, please don't use this online service for your development purpose; instead, we recommend creating and using your own local service for development purposes in your end.
For your convenience, we have attached the local service sample along with the React sample below.
Service sample: Please see the attachment.
Client sample: Xkpjww (forked) - StackBlitz
After taking the local service from the attachment, please follow the below steps to launch the local service on your end.
For your convenience, we have attached the open and save code snippets of local service below.
Code snippet:
[HttpPost] [Route("Open")] public IActionResult Open([FromForm]IFormCollection openRequest) { OpenRequest open = new OpenRequest(); open.File = openRequest.Files[0]; return Content(Workbook.Open(open)); } //Save method [HttpPost] [Route("Save")] public IActionResult Save([FromForm]SaveSettings saveSettings) { return Workbook.Save(saveSettings); } |
After, launching the local service, you need to update the open and save URL in the Client-Side sample like in the below code snippet,
saveUrl= 'https://localhost:{port number}/api/spreadsheet/save'
openUrl= 'https://localhost:44354/api/spreadsheet/open' saveUrl= 'https://localhost:44354/api/spreadsheet/save' |
Note: Launch the service before running the client-side sample.
For local service you need ASP.NET Core project as a backend for Open/Save functionality in your client application.
As we mentioned in our previous update, the local service is available at the GitHub location below:
https://github.com/SyncfusionExamples/EJ2-Spreadsheet-WebServices/
Create ASP.NET Core project and generate the license based on the below KB link.
https://www.syncfusion.com/kb/8976/how-to-generate-license-key-for-essential-studio-products
And include the licensed key in your project startup file as like in the below documentation link.
https://help.syncfusion.com/common/essential-studio/licensing/license-key
You can also host and run our Spreadsheet-oriented service as a Docker image. Utilizing a Docker image necessitates only a simple and basic Docker environment with minimal commands to effortlessly host and run our service.
You can utilize the below service and use it for Spreadsheet Open and Save services, by pulling the spreadsheet docker image and following the steps from the URL mentioned below.
Spreadsheet docker image: https://hub.docker.com/r/syncfusion/spreadsheet-server
For more information regarding the docker deployment, please refer the below documentation,
https://ej2.syncfusion.com/react/documentation/spreadsheet/docker-deployment
Kindly refer to the documentation below to learn more about our Open and Save support in our spreadsheet.
https://ej2.syncfusion.com/react/documentation/spreadsheet/open-save