Skip to content
Snippets Groups Projects
Commit a985b095 authored by Janez Urevc's avatar Janez Urevc
Browse files

Merge pull request #12 from primsi/2555397_incorrect_temp_path_osx

Issue #2555397 by Primsi: Uploads on osx fail with input stream relat…
parents 225daed6 657324a0
No related branches found
No related tags found
No related merge requests found
...@@ -205,7 +205,7 @@ class UploadController extends ControllerBase { ...@@ -205,7 +205,7 @@ class UploadController extends ControllerBase {
} }
// Read binary input stream. // Read binary input stream.
$input_uri = "{$this->temporaryUploadLocation}/{$file->getFilename()}"; $input_uri = $file->getFileInfo()->getRealPath();
if (!($in = fopen($input_uri, 'rb'))) { if (!($in = fopen($input_uri, 'rb'))) {
throw new UploadException(UploadException::INPUT_ERROR); throw new UploadException(UploadException::INPUT_ERROR);
} }
......
...@@ -122,7 +122,8 @@ class DropzoneJs extends FormElement { ...@@ -122,7 +122,8 @@ class DropzoneJs extends FormElement {
if (!empty($user_input['uploaded_files'])) { if (!empty($user_input['uploaded_files'])) {
$file_names = array_filter(explode(';', $user_input['uploaded_files'])); $file_names = array_filter(explode(';', $user_input['uploaded_files']));
$temp_path = \Drupal::config('system.file')->get('path.temporary'); $tmp_override = \Drupal::config('dropzonejs.settings')->get('tmp_dir');
$temp_path = ($tmp_override) ? $tmp_override : \Drupal::config('system.file')->get('path.temporary');
foreach ($file_names as $name) { foreach ($file_names as $name) {
// The upload handler appended the txt extension to the file for // The upload handler appended the txt extension to the file for
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment