diff -u b/modules/filefield_paths.inc b/modules/filefield_paths.inc --- b/modules/filefield_paths.inc +++ b/modules/filefield_paths.inc @@ -69,7 +69,8 @@ // Process filepath. $settings['file_path']['options']['context'] = 'file_path'; - $file['uri'] = "{$field['settings']['uri_scheme']}://" . ltrim(filefield_paths_process_string($settings['file_path']['value'], $token_data, $settings['file_path']['options']) . "/{$file['filename']}", '/'); + $path = filefield_paths_process_string($settings['file_path']['value'], $token_data, $settings['file_path']['options']); + $file['uri'] = file_stream_wrapper_uri_normalize($scheme . '/' . $path . '/' . $file['filename']); // Finalize file if necessary. if ($file !== $old_file) {