Skip to content

Commit

Permalink
Update redactor_filemanager.module
Browse files Browse the repository at this point in the history
  • Loading branch information
polem committed Dec 7, 2015
1 parent a1baecf commit 8b70aeb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/redactor_filemanager/redactor_filemanager.module
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,16 @@ function redactor_filemanager_upload($wysiwyg_profile) {
$config = redactor_get_plugin_config('filemanager', $wysiwyg_profile);

$file = file_unmanaged_copy($_FILES['file']['tmp_name'], $config['upload_dir'] . $_FILES['file']['name']);
$file = file_create_url($file);
$filelink = file_create_url($file);

$extension = pathinfo($file, PATHINFO_EXTENSION);

drupal_json_output(array(
'filename' => $_FILES['file']['name'],
'filelink' => $file
'filelink' => $filelink,
'size' => format_size(filesize($file)),
'mime' => file_get_mimetype($file),
'ext' => $extension
));
}

Expand Down Expand Up @@ -172,4 +177,3 @@ function redactor_filemanager_wysiwyg_editor_settings_alter(&$settings, $context
$settings['fileManagerJson'] = url('redactor/filemanager/'.$profile->format.'/files.json');
$settings['fileUpload'] = url('redactor/filemanager/'.$profile->format.'/upload');
}

0 comments on commit 8b70aeb

Please sign in to comment.