As it still is a top result in Google:
The original code still works for the most part. What throws an error is this line:
function my_acf_upload_prefilter( $errors, $file, $field ) {
WordPress expects one parameter only here, so do this instead:
function my_acf_upload_prefilter( $file ) {