diff options
author | Francis Irving <francis@mysociety.org> | 2010-05-19 17:04:52 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-05-19 17:04:52 +0100 |
commit | 857a61ddf2b816d5d9599a8f14a71c3d9826e99c (patch) | |
tree | 62c5856929e3ffc34f6910b89b400fa5ab0dd910 /app/controllers/request_controller.rb | |
parent | ecf920001a80d4eaa4fa34c7c465fe7e00964f32 (diff) |
Need to make the directory before writing to it.
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 1357f993b..11e313caa 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -562,6 +562,7 @@ class RequestController < ApplicationController # various fragment cache functions using Ruby Marshall to write the file # which adds a header, so isnt compatible with images that have been # extracted elsewhere from PDFs) + FileUtils.mkdir_p(File.dirname(key_path)) File.open(key_path, 'wb') {|f| f.write(response.body) } end |