diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rb index 0f559f89f05..a4068e57d12 100644 --- a/lib/file_store/local_store.rb +++ b/lib/file_store/local_store.rb @@ -34,8 +34,12 @@ module FileStore "#{Discourse.asset_host}#{relative_base_url}" end + def upload_path + "/uploads/#{RailsMultisite::ConnectionManagement.current_db}" + end + def relative_base_url - "#{Discourse.base_uri}/uploads/#{RailsMultisite::ConnectionManagement.current_db}" + "#{Discourse.base_uri}#{upload_path}" end def external? @@ -57,7 +61,7 @@ module FileStore end def get_path_for(type, upload_id, sha, extension) - "#{relative_base_url}/#{super(type, upload_id, sha, extension)}" + "#{upload_path}/#{super(type, upload_id, sha, extension)}" end def copy_file(file, path)