File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,22 @@ def gstore
6868 end
6969 @files = @files [ start ..last ]
7070 @fgcz = SushiFabric ::Application . config . fgcz?
71+
7172 if @fgcz and !@files
72- redirect_to "https://fgcz-gstore.uzh.ch/projects/#{ @path } .#{ params [ :format ] } "
73+ file_ext = params [ :format ]
74+ file_path = "#{ @path } .#{ file_ext } "
75+ file_full_path = File . join ( SushiFabric ::GSTORE_DIR , file_path )
76+
77+ case file_ext
78+ when /gz$|bam$/
79+ redirect_to "https://fgcz-gstore.uzh.ch/projects/#{ file_path } "
80+ when /html$/
81+ send_file file_full_path , disposition : 'inline' , type : 'text/html'
82+ when /log$|tsv$|txt$|sh$/
83+ send_file file_full_path , disposition : 'inline' , type : 'text/plain'
84+ else
85+ send_file file_full_path , disposition : 'inline'
86+ end
7387 end
7488 end
7589 end
You can’t perform that action at this time.
0 commit comments