Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/packages/package_files_controller.rb')
-rw-r--r--app/controllers/projects/packages/package_files_controller.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/controllers/projects/packages/package_files_controller.rb b/app/controllers/projects/packages/package_files_controller.rb
new file mode 100644
index 00000000000..dd6d875cd1e
--- /dev/null
+++ b/app/controllers/projects/packages/package_files_controller.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module Projects
+ module Packages
+ class PackageFilesController < ApplicationController
+ include PackagesAccess
+ include SendFileUpload
+
+ def download
+ package_file = project.package_files.find(params[:id])
+
+ send_upload(package_file.file, attachment: package_file.file_name)
+ end
+ end
+ end
+end