headers["Content-Length"] ||= file.size.to_s
options[:filename] ||= File.basename(file.path) unless options[:url_based_filename]
headers["Content-Length"] ||= file.size.to_s
options[:filename] ||= File.basename(file.path) unless options[:url_based_filename]