I changed the cleanup stuff to a perlcleanup handler, but I want to check if the temp directory, where the upload should store stuff, does already exist. and if it's exist quit immediately but since I switched to modperl it waits until the whole upload has finished before it quit.
Changeing exit() to Apache2::Const::OK didn't help. $r->discard_request_body(); <-- doesn't help at all if(-d $sid) { $r->set_handlers(PerlCleanupHandler => undef); $r->discard_request_body(); my $cgi = new CGI; print $cgi->redirect('/upload/?error=1&sid=duplicated'); exit; } This peace of codes is in front of the cgi upload, but it doesn't seem to be handled before the upload is finished. Why ?
signature.asc
Description: This is a digitally signed message part