diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 49c4c04b..b4b82948 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -463,9 +463,8 @@ EOL end end files = @web.files_path - Dir.foreach(files) do |f| - next if ['.', '..'].include?(f) - zip_out.add "files/#{f}", File.join(files, f) + Dir["#{files}/**/*"].each do |f| + zip_out.add "files#{f.sub(files.to_s,'')}", f end end FileUtils.rm_rf(Dir[@wiki.storage_path.join(file_prefix + '*.zip').to_s])