0
@@ -17,24 +17,24 @@ module ActionController #:nodoc:
0
# it feasible to send even large files.
0
# Be careful to sanitize the path parameter if it coming from a web
0
- # page.
send_file(params[:path]) allows a malicious user to
0
+ # page.
<tt>send_file(params[:path])</tt> allows a malicious user to
0
# download any file on your server.
0
# * <tt>:filename</tt> - suggests a filename for the browser to use.
0
- # Defaults to
File.basename(path).
0
+ # Defaults to
<tt>File.basename(path)</tt>.
0
# * <tt>:type</tt> - specifies an HTTP content type.
0
# Defaults to 'application/octet-stream'.
0
# * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded.
0
# Valid values are 'inline' and 'attachment' (default).
0
- # * <tt>:stream</tt> - whether to send the file to the user agent as it is read (true)
0
- # or to read the entire file before sending (false). Defaults to true.
0
+ # * <tt>:stream</tt> - whether to send the file to the user agent as it is read (+true+)
0
+ # or to read the entire file before sending (+false+). Defaults to +true+.
0
# * <tt>:buffer_size</tt> - specifies size (in bytes) of the buffer used to stream the file.
0
# * <tt>:status</tt> - specifies the status code to send with the response. Defaults to '200 OK'.
0
- # * <tt>:url_based_filename</tt> - set to
true if you want the browser guess the filename from
0
+ # * <tt>:url_based_filename</tt> - set to
+true+ if you want the browser guess the filename from
0
# the URL, which is necessary for i18n filenames on certain browsers
0
- # (setting
:filename overrides this option).
0
+ # (setting
<tt>:filename</tt> overrides this option).
0
# The default Content-Type and Content-Disposition headers are
0
# set to download arbitrary binary files in as many browsers as
0
@@ -42,17 +42,20 @@ module ActionController #:nodoc:
0
# a variety of quirks (especially when downloading over SSL).
0
# send_file '/path/to.zip'
0
# Show a JPEG in the browser:
0
# send_file '/path/to.jpeg', :type => 'image/jpeg', :disposition => 'inline'
0
# Show a 404 page in the browser:
0
# send_file '/path/to/404.html', :type => 'text/html; charset=utf-8', :status => 404
0
# Read about the other Content-* HTTP headers if you'd like to
0
- # provide the user with more information (such as Content-Description).
0
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
0
+ # provide the user with more information (such as Content-Description) in
0
+ # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11.
0
# Also be aware that the document may be cached by proxies and browsers.
0
# The Pragma and Cache-Control headers declare how the file may be cached
0
@@ -95,7 +98,7 @@ module ActionController #:nodoc:
0
# and specify whether to show data inline or download as an attachment.
0
- # * <tt>:filename</tt> -
Suggests a filename for the browser to use.
0
+ # * <tt>:filename</tt> -
suggests a filename for the browser to use.
0
# * <tt>:type</tt> - specifies an HTTP content type.
0
# Defaults to 'application/octet-stream'.
0
# * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded.
0
@@ -103,12 +106,15 @@ module ActionController #:nodoc:
0
# * <tt>:status</tt> - specifies the status code to send with the response. Defaults to '200 OK'.
0
# Generic data download:
0
# Download a dynamically-generated tarball:
0
# send_data generate_tgz('dir'), :filename => 'dir.tgz'
0
# Display an image Active Record in the browser:
0
# send_data image.data, :type => image.content_type, :disposition => 'inline'
0
# See +send_file+ for more information on HTTP Content-* headers and caching.
Comments
No one has commented yet.