Drupal: 7.41

I chose "821 issue.mp4" from Dropbox and got these:

  • Notice: Undefined index: extension in file_chooser_field_file_info() (line 260 of /usr/share/nginx/8093-drupal-gosimple-dev/sites/all/modules/file_chooser_field/file_chooser_field.field.inc).
  • The specified file storage-field-file:_3. could not be uploaded. Only files with the following extensions are allowed: mp4.

I can see "storage-field-file:_3" in storage folder (private file storage is used).

I've added "dpm" for $path and $file

function file_chooser_field_file_info($path) {
  $file = pathinfo($path);
  dpm($path);
  dpm(print_r($file, true));

  $finfo = @finfo_open(FILEINFO_MIME_TYPE);
  $mimetype = @finfo_file($finfo, $path);
  $contents = file_get_contents($path);

  $info = array(
    'filename'  => $file['basename'],
    'extension' => $file['extension'],
    'mimetype'  => $mimetype,
    'filesize'  => strlen($contents)
  );
  return (object) $info;
}

$path
/usr/share/nginx/8093-drupal-gosimple-dev/../web-dev-files-storage/storage-field-file:_3

$file

Array
(
    [dirname] => /usr/share/nginx/8093-drupal-gosimple-dev/../web-dev-files-storage
    [basename] => storage-field-file:_3
    [filename] => storage-field-file:_3
)
CommentFileSizeAuthor
bug.png85.59 KBipto
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ipto created an issue.

minnur’s picture

Were you able to fix this issue ?