attachment view
This commit is contained in:
parent
9c9ccc429d
commit
f5edf91670
|
@ -438,11 +438,11 @@ class WebmailController < ApplicationController
|
|||
else
|
||||
disposition = "attachment"
|
||||
end
|
||||
@headers['Content-Length'] = part.body.size
|
||||
@response.headers['Accept-Ranges'] = 'bytes'
|
||||
@headers['Content-type'] = part.content_type.strip
|
||||
@headers['Content-Disposition'] = disposition << %(; filename="#{part.header['content-type']['name']}")
|
||||
render_text part.body
|
||||
headers['Content-Length'] = part.body.size
|
||||
response.headers['Accept-Ranges'] = 'bytes'
|
||||
headers['Content-type'] = part.content_type.strip
|
||||
headers['Content-Disposition'] = disposition << %(; filename="#{part.header['content-type']['name']}")
|
||||
render :text => part.body
|
||||
end
|
||||
|
||||
def get_parts(mail)
|
||||
|
|
|
@ -126,13 +126,13 @@ module Mail2Screen
|
|||
if filename == ""
|
||||
""
|
||||
else
|
||||
"<span class='attachment'> <a href='/webmail/webmail/download?msg_id=#{msg_id}&ctype=" << CGI.escape(filename) << "'>#{filename}</a></span>"
|
||||
"<span class='attachment'> <a href='/webmail/download?msg_id=#{msg_id}&ctype=" << CGI.escape(filename) << "'>#{filename}</a></span>"
|
||||
end
|
||||
end
|
||||
|
||||
def add_image(content_type, msg_id)
|
||||
filename = (content_type.nil? or content_type['name'].nil? ? "" : content_type['name'])
|
||||
"<hr/><span class='attachment'><br/><img src='/webmail/webmail/download?msg_id=#{msg_id}&ctype=" << CGI.escape(filename) << "' alt='#{filename}'/></span>"
|
||||
"<hr/><span class='attachment'><br/><img src='/webmail/download?msg_id=#{msg_id}&ctype=" << CGI.escape(filename) << "' alt='#{filename}'/></span>"
|
||||
end
|
||||
|
||||
def friendly_address(addr)
|
||||
|
|
Loading…
Reference in a new issue