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 determin
use PCEL uploadprogress extension if you use apache
create an file to poll meta via Ajax, and return trueor false based on your condition, you could also get the temp_name file and check for the 1kb meta.
the ajax call need to be binded with an function which uses HTML meta-refresh headers to redirect or stay until the uploads done.