--- file.inc.orig 2008-07-05 09:58:23.000000000 +0200 +++ file.inc 2008-07-05 10:04:17.000000000 +0200 @@ -26,16 +26,18 @@ * @param $path A string containing the path of the file to generate URL for. * @return A string containing a URL that can be used to download the file. */ -function file_create_url($path) { +function file_create_url($path, $absolute = TRUE) { // Strip file_directory_path from $path. We only include relative paths in urls. if (strpos($path, file_directory_path() . '/') === 0) { $path = trim(substr($path, strlen(file_directory_path())), '\\/'); } switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) { case FILE_DOWNLOADS_PUBLIC: - return $GLOBALS['base_url'] .'/'. file_directory_path() .'/'. str_replace('\\', '/', $path); + // We can see the same line in url() function + $base = ($absolute ? $GLOBALS['base_url'] . '/' : base_path()); + return $base . file_directory_path() .'/'. str_replace('\\', '/', $path); case FILE_DOWNLOADS_PRIVATE: - return url('system/files/'. $path, NULL, NULL, TRUE); + return url('system/files/'. $path, NULL, NULL, $absolute); } }