'Can I redirect the user to another page while uploading files to the server?

I have a php script that: compresses and sends to the server images uploaded by the user, sends the text inputs as email, and then does a redirect with header('location:...'). So, the user needs to wait for this process's finishing to be redirected to another page. It takes too much time to keep them waiting. How could I work around this problem? I really appreciate any help you can provide.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source