Last post Jul 12, 2016 03:11 PM by Mikesdotnetting
Jul 06, 2016 07:57 AM|bala1990|LINK
I work in a SPA . View is in JS and view model is in c#.
The requirement is that the user will upload an excel file and the application need to validate it and then upload its content in to the Datatabase . I am new to MVVM model so I was not completely aware about it .
I completed this functionality in the following way
1. User selectes the respective excel file.
3. The rows which fails the validation are highlighted in Yellow and the description of the error is added as a comment in the cell . All this was possible in c#.
This worked fine when I ran the source code from my local machine . But When I deploy it in the site . It didnt work as I understood that the applicaiton is actually searching for the file path in ther server where the Website is deployed instead of the
As a quickfix , I thought of copying the excel file from the client system to the server , process the file and copy it back to the client system .
Is this possible ?
This is an urgetn fix :( .Please suggest me by providing your ideas . Appreciate your help .
Jul 11, 2016 07:18 AM|Mikesdotnetting|LINK
Jul 11, 2016 07:22 AM|bala1990|LINK
Hi Mike ,
Jul 11, 2016 08:15 AM|Mikesdotnetting|LINK
I use jQuery to manage this. The following line of code should be added to whatever event handler you want to cause the download:
So if you wanted the download to happen on page load:
Or on a button click:
Jul 12, 2016 01:57 PM|bala1990|LINK
I need to copy the Excel contents to a sql table after some validaiton and processing. Which of these options work ?
1. Copying the excel file from client to server and then process the data.
2. Extract the excel data from the UI side and send it to the server for processing .
Appreciate your inputs and suggestions.
Jul 12, 2016 03:11 PM|Mikesdotnetting|LINK
It's a two stage process. The user has to upload the file for validation, and then they have to make alterations if required and upload it for import. In this type of scenario, you need to make the process as user friendly as possible. They know where the
original file is, so you might confuse them if you download a copy with comments in it. They might make changes to that and then attempt to upload the original again. If this was my task, I'd display the validation errors in the browser and let them use that
as reference while amending the original.