Make inline uploader (plupload) on options page upload to a specific folder

I finally found a solution that works for me which I want to share with you. It’s more or less what EHerman posted here, I just made some little changes to adapt the code to my case. Basicly the idea is to find out that the upload comes from my admin page. This is done by checking the referrer for my admin page’s name if ( strpos( $referrer, 'page=syk-bulk-import' ) !== false ...:

add_filter( 'admin_init', 'syk_bulk_import_admin', 999 );
function syk_bulk_import_admin() {
  global $pagenow;
  $referrer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '';
  if ( strpos( $referrer, 'page=syk-bulk-import' ) !== false && ( 'async-upload.php' == $pagenow || 'media-upload.php' == $pagenow ) ) {
    add_filter( 'upload_dir', 'syk_admin_uldir_switch' );
  }
}

function syk_admin_uldir_switch( $upload_dir ) {
  $upload_dir['subdir'] = '/symbole';
  $upload_dir['path'] = $upload_dir['basedir'].$upload_dir['subdir'];
  $upload_dir['url']  = $upload_dir['baseurl'].$upload_dir['subdir'];
  return $upload_dir;
}

PHP 8 introduced str_contains() which would probably be more accurate instead of the strpos() statement.