Redirecting before POST upload has been completed

Posted by vartec on Stack Overflow See other posts from Stack Overflow or by vartec
Published on 2010-05-28T14:39:00Z Indexed on 2010/05/28 14:41 UTC
Read the original article Hit count: 176

Filed under:
|
|
|

I have form with file upload. The files to be uploaded actually are pictures and videos, so they can be quite big. I have logic which based on headers and first 1KB can determine if the rest will be processed or immediately rejected. In the later case I'd like to redirect client to error page without having to wait for upload to finish.

The case is, that just sending response before POST is complete doesn't seem to work. The redirect get's ignored and if I close connection, browser complains with "Connection reset by peer" error.

So the question is: is it even possible to do that in pure HTTP (without JavaScript on client-side), and if so, how?

© Stack Overflow or respective owner

Related posts about http

Related posts about redirect