Files that begin with non-ascii characters have those characters stripped when downloaded from webFM.

The cause is related to #755578: IE not support UTF-8 MIME attachment filenames.

Comments

wdouglascampbell’s picture

Opps. Copy and pasted wrong issue #. The correct issue that this is related to is #278425: Using basename() is not locale safe.

wdouglascampbell’s picture

I fixed this for myself and will include what I did here for those needing a quick fix solution. I'm sure the developers can do this much better than I.

Fixed by adding the following drupal_basename() function to the end of includes/common.inc

function drupal_basename($path, $suffix = '') {
  $path = preg_replace('|^.+[\\/]|', '', $path);
  if ($suffix) {
    $path = preg_replace('|'. preg_quote($suffix) .'$|', '', $path);
  }
  return $path;
}

and by changing the following lines in webfm.module

in function webfm_send_file, change:

  $name=basename($f->fpath);

to:

  $name=drupal_basename($f->fpath);

in class webfm_fdesc, change:

            if(is_file($readdir) && ($readdir == basename($file->fpath))) {

to:

            if(is_file($readdir) && ($readdir == drupal_basename($file->fpath))) {
nhck’s picture

Status: Active » Closed (duplicate)

wdouglascampbell,
thank you for reporting this and helping to make webfm better. In my opinion we have fixed this some time ago:

#806614: "file X path not found" when adding file to node (file name contains Russian characters)

Thank you.