I ran into the same problem. No upload for me in the frontend. As tgnsd mentioned earlier when the backend is disabled the ajax thing won’t work. I changed my code to this and the upload worked!
add_action( 'init', 'blockusers_init' );
function blockusers_init() {
if ( is_admin() && ! current_user_can( 'administrator' ) &&
! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
wp_redirect( home_url() );
exit;
}
}
I get this from here: https://premium.wpmudev.org/blog/limit-access-to-your-wordpress-dashboard/