attachments error

This commit is contained in:
yanxd 2014-06-17 18:38:13 +08:00
parent 9b707f2b5a
commit 8840a11a99
2 changed files with 25 additions and 0 deletions

View File

@ -59,6 +59,8 @@ class AttachmentsController < ApplicationController
:type => detect_content_type(@attachment),
:disposition => (@attachment.image? ? 'inline' : 'attachment')
end
rescue => e
redirect_to "http://forge.trustie.net/file_not_found.html"
end
#更新资源文件类型

View File

@ -0,0 +1,23 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<title>文件未找到</title>
<style>
body{
font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
color:#303030;
margin:10px;
}
h1{
font-size:1.5em;
}
p{
font-size:0.8em;
}
</style>
<body>
<h1>文件已经损坏</h1>
<p>抱歉,因文件已经损坏,请重新上传此文件.</p>
<p><a href="javascript:history.back()">Back</a></p>
</body>
</html>