Description:
[web] confirm when start contest, downloading task description through apache
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@260 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r130:f343b8fb7d21 - - 3 files changed: 12 inserted, 4 deleted
@@ -11,6 +11,16 | |||
|
11 | 11 | @user = User.find(session[:user_id]) |
|
12 | 12 | end |
|
13 | 13 | |
|
14 | + def view | |
|
15 | + file_name = "#{RAILS_ROOT}/data/tasks/#{params[:file]}" | |
|
16 | + if !FileTest.exists?(file_name) | |
|
17 | + redirect_to :action => 'index' and return | |
|
18 | + end | |
|
19 | + # ask Apache to send the file | |
|
20 | + response.headers['X-Sendfile'] = file_name | |
|
21 | + render :nothing => true | |
|
22 | + end | |
|
23 | + | |
|
14 | 24 | protected |
|
15 | 25 | |
|
16 | 26 | def check_viewability |
You need to be logged in to leave comments.
Login now