Hello,
We are using JRuby 1.5.1/ruby 1.8.7/Rails 2.3.8 with a GWT front end.
I'm having an issue when attempting to send a server side .csv file to
the user using rails send_file.
my code is:
send_file(path_to_file, type=>'text/csv')
While this is returning fine with an http status of 200, the
"Mac thinks it's an xml file." -> Does the file end up with an .xml
extension in your Downloads dir? and/or when you try to open it some
program registered to .xml extension opens it or what?
Which browser and what do you see in the Response headers? All browsers do
the same thing?
--
Chris
htt
I'm trying to use send_data to send a simple text file.
Every reference I can find says I can supply a MIME type with the
":type" option and that will determine the kind of file I get on the
machine that downloads the file I'm sending. Instead I ALWAYS get an
XML file.
here's the code snippet:
On 17 Feb 2011, at 15:34, David Zhu wrote:
I'm using send_data to retrieve binary (images) from the database.
It works fine, this is my controller :
@picture = Picture.find(params[:id])
@image = @picture.image_file
send_data (@image, :type => @picture.image_content_type, :filename
=> @p
Hello,
I'm using send_data to retrieve binary (images) from the database.
It works fine, this is my controller :
@picture = Picture.find(params[:id])
@image = @picture.image_file
send_data (@image, :type => @picture.image_content_type, :filename =>
@picture.image_file_name, :disposition
On 01 Feb 2011, at 14:41, Tushar Gandhi wrote:
I am uploading a PDF file using paper clip. File get uploaded
successfully. If I try to view the file directly from file system it
is
opening.
I have to open the file from application so I have written following
code.
View Code:-
<%= link_to 'Vi
Hi,
I am uploading a PDF file using paper clip. File get uploaded
successfully. If I try to view the file directly from file system it is
opening.
I have to open the file from application so I have written following
code.
View Code:-
<%= link_to 'View Attachment', {:action=>"show_attachment",
:id=>
On 28 June 2010 21:45, dieinzige wrote:
> what the hell are u doing, if u have file, u can simplify get link to user,
What if the OP needs users to be logged in to view files? Or complete
some other approval process. Not much sense having them accessible
from the public directory in that instance
what the hell are u doing, if u have file, u can simplify get link to user, for
it
it will be more faster than use rails, and more native for user
Best Regards, dieinzige
On 28 Jun, 2010,at 03:56 PM, Mamadou Touré wrote:
I want to display a pdf on my browser bu using
send_data(File.read(FIL
On 28 Jun 2010, at 17:56, Mamadou Touré wrote:
I want to display a pdf on my browser bu using
send_data(File.read(FILE_PATH + FILE_NAME), :type =>
'application/pdf',:disposition => 'inline', :filename => FILE_NAME)
But nothing happens. Do you know why ?
Serving it via AJAX or a normal reques
I want to display a pdf on my browser bu using
send_data(File.read(FILE_PATH + FILE_NAME), :type =>
'application/pdf',:disposition => 'inline', :filename => FILE_NAME)
But nothing happens. Do you know why ?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are s
I'm trying to display a generated .png plot via send_data(), but it
results in a server error "invalid byte sequence in US-ASCII" error.
I'm pretty sure this means that I need to specify the encoding
somewhere, but I haven't been able to figure out where or how to do so.
Some particulars:
I'm run
I'm a newbie having trouble using send_data to send a jpeg file to the
browser for display in an html img tag. This is the relevant code
from my controller (photos_controller.rb):
def retrieve
@photo = Photo.find(params[:id])
send_data File.read(@photo.abs_img_path), :type => "image/
jpeg",
13 matches
Mail list logo