On Jun 18, 10:51 pm, ray wrote:
> same problem. save_file fails. no user dialog box to open or save the
> file.
>
> send_file(path, :type => "application/pdf", :disposition => "inline" )
>
> works in Rails 2
> fails in Rails 3 with Activescaffold and webrick or thin.
>
inline means that the bro
same problem. save_file fails. no user dialog box to open or save the
file.
send_file(path, :type => "application/pdf", :disposition => "inline" )
works in Rails 2
fails in Rails 3 with Activescaffold and webrick or thin.
I am also interested in any ideas why this isn't working?
--
You receive
Bingo!
No need for send_data in the first place.
This was all i needed, in the view: <%=
image_tag("/pictures/#{@picture.id}", :alt => "Image") %>
Now the image displays inside a layout. Sweet.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk
On Feb 2, 4:52 am, Tushar Gandhi wrote:
> Hi,
> Thanks for your reply, but still it is not working.
send_data expects you to be giving it the actual bytes to send, not a
url or a file path. You need to read the file yourself (or use
send_file which will take care of that)
Fred
>
> Any other su
Hi,
Thanks for your reply, but still it is not working.
Any other suggestion.
Thanks,
Tushar
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-ta
On 30 Jun 2010, at 18:13, Mamadou Touré wrote:
Unfortunately I have to hav each file on its own, I must not merge
them
in on single file. Is there a way to simulate several requests in
order
to loop through the array ?
Even if there were, the browser would not be able to understand
it.
Marnen Laibow-Koser wrote:
> Mamadou Touré wrote:
> [...]
>>>
>>>
>>>
>>>
>> Thanks Marnen,
>>
>> Unfortunately I have to hav each file on its own, I must not merge them
>> in on single file. Is there a way to simulate several requests in order
>> to loop through the array ?
>
> Even if the
Mamadou Touré wrote:
[...]
>>
>>
>>
>>
> Thanks Marnen,
>
> Unfortunately I have to hav each file on its own, I must not merge them
> in on single file. Is there a way to simulate several requests in order
> to loop through the array ?
Even if there were, the browser would not be able to un
Mamadou Touré wrote:
[...]
>>
>>
>>
>>
> Thanks Marnen,
>
> Unfortunately I have to hav each file on its own, I must not merge them
> in on single file. Is there a way to simulate several requests in order
> to loop through the array ?
Even if there were, the browser would not be able to un
Marnen Laibow-Koser wrote:
> Mamadou Touré wrote:
> [...]
>>
>> I'm having the file displayed now, but the other issue that I'm facing
>> now is : I have several files to open, I put them in an array that I
>> loop through, but only the last file is opened:
>>
>> What's wrong ?
>>
>> arr.each
Mamadou Touré wrote:
[...]
>
> I'm having the file displayed now, but the other issue that I'm facing
> now is : I have several files to open, I put them in an array that I
> loop through, but only the last file is opened:
>
> What's wrong ?
>
> arr.each do |form|
> file_name = form + "-
Michael Pavling wrote:
> 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
On 28 Jun 2010, at 19:28, Mamadou Touré wrote:
Peter De Berdt wrote:
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 not
Peter De Berdt wrote:
> 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 ?
>
Sharagoz wrote:
> I dont know if it's related to the actual error message you are
> getting, but I believe your send_data call should look more like this:
> send_data(report.imagedata, :disposition => 'inline', :type => 'image/
> png', :filename => "graph.png")
> You are setting it to a GIF, and no
I dont know if it's related to the actual error message you are
getting, but I believe your send_data call should look more like this:
send_data(report.imagedata, :disposition => 'inline', :type => 'image/
png', :filename => "graph.png")
You are setting it to a GIF, and not setting the disposition
okay here's the solution (graciously provided by someone on
stackoverflow.com) --
I modified the retrieve action in my controller to use File.open
first:
def retrieve
@photo = Photo.find(params[:id])
File.open(@photo.abs_img_path, 'rb') do |f|
send_data f.read, :type => "image/jpeg", :di
A little more info now... when I simulate the img tag request by
typing www.myapp.com/photos/5/retrieve into the browser, I get the
following line in my Apache access.log:
"GET /photos/5/retrieve HTTP/1.1" 304 0
whereas if I type in the url to one of my public images (www.myapp.com/
images/logo.
18 matches
Mail list logo