Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
)
Comments
Comment #2
minnur CreditAttribution: minnur commentedWere you able to fix this issue ?