0

What will be the possible ways to send multiple responses to the client side within a Ajax call.

Scenario

1.Import 200 records from excel through Ajax.

2.Read file record one by one.

3.On each iteration I need to send some data to client side and get it back with some base 64 image on server side and then save that image into the database.

4.Do this for all the iterations.

5.After all iterations show Ajax success message.

How can I achieve this with in one Ajax request.

3
  • Why does point #3 need to go to the client? Commented Feb 14, 2019 at 1:44
  • We need client help to make a base 64 image from JS library - Konva. Each record fetch some data from database and send it to client which make an image from it and send it back to the server to save it in database. Commented Feb 14, 2019 at 6:17
  • Unless you can replace Konva with something from the server-side, you will have to do multiple AJAX calls. It cannot be one AJAX request by nature. Commented Feb 14, 2019 at 11:45

1 Answer 1

0

So finally We did it by Signal R.

We can achieve this by Web Sockets or Signal R. Signal R opens a communication channel for client side from there we can get any data to the server again.

Note Don't forget to increase the size of Signal R message buffer if anyone wants to send a large file through Signal R e.g.

GlobalHost.Configuration.DefaultMessageBufferSize = 200
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.