3

So I have a PHP script that handles post requests. It works quite good, but (always a but) the data I am receiving is encoded. I need to run an external program to decode it. That also works.

My problem is, that my client connects to the server, does a POST and waits for the OK reply from the server, to verify that the post request has been handled correctly. Now when I add the part of the Decoder into my POST request handling script, it takes some time for my client to receive the OK from the server. It is only sending it back when the entire script has been finished, and not only the uploading of the files part, understandably.

What I was wondering now, can I do this in another way? When the uploading of the files is done, the client should now that the upload is finished. He should not have to worry about the decoding part. I also need it to decode immediately after the POST request has been handled, so I'm a bit puzzled at how I need to do this...

Don't really think I need to give out my code but if the need should arise i'll be glad to oblige.

user2524670
  • 277
  • 1
  • 3
  • 11
  • The processing queue suggested by Barman's link is good. Also consider posting the request by ajax, then wait for a response and update some part of the page with the status of the long process. In the meantime the user will be able to go on interacting with the page. – crafter Oct 10 '13 at 17:26

0 Answers0