From 857a61ddf2b816d5d9599a8f14a71c3d9826e99c Mon Sep 17 00:00:00 2001 From: Francis Irving Date: Wed, 19 May 2010 17:04:52 +0100 Subject: Need to make the directory before writing to it. --- app/controllers/request_controller.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/controllers/request_controller.rb') 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 -- cgit v1.2.3