diff --git a/app/models/repository.rb b/app/models/repository.rb
index 6bfdf2255f2b812b7132ec7331660f7ef06d1047..9032905ce9a7b3f39248489476d581374d144629 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -151,7 +151,7 @@ class Repository
     return nil unless commit
 
     # Build file path
-    file_name = self.path_with_namespace + "-" + commit.id.to_s + ".tar.gz"
+    file_name = self.path_with_namespace.gsub("/","_") + "-" + commit.id.to_s + ".tar.gz"
     storage_path = Rails.root.join("tmp", "repositories")
     file_path = File.join(storage_path, file_name)