Displaying 20 results from an estimated 100000 matches similar to: "render file in a new browser tab"
2007 Mar 16
0
Modifying title of browser window when rendering a file
All,
I am using this to render a file to a browser window (a popup) -
send_file(''xyz'', :type => ''application/pdf'', :disposition => ''inline'')
By default, the window''s title bar shows the host and the name of the
controller action (in FF) or the entire URL (in IE).
Does anyone know of a way to modify the content of the title
2005 Mar 06
1
Force a file download AND render a page
I have managed to force the download of a pdf to the user''s computer,
and make the link appear on a page rendered for the user. I cannot
figure out how to do both, however. You know "Your download will begin
shortly, if not click _here_"
Relevant controller code:
(this is solely for testing purposes, i will sanitize the path and such
later)
def test_render_first(path)
# send
2007 Mar 08
0
Using send_file and handling browser side cacheing
I''m using send_file to send rather large SWF files that I''d prefer the
end browser to cache to reduce my bandwidth usage.
I''ve used the method suggested by madrobby (http://mir.aculo.us/
2005/08/28/internet-explorer-and-ajax-image-caching-woes) to try to
catch the HTTP_IF_MODIFIED_SINCE request header, and then return HTTP
304 if necessary. However, this only seems to
2008 Sep 24
5
Re: save blob to file?
Frederick Cheung wrote:
> On 14 Aug 2008, at 15:11, John Griffiths wrote:
>
>>
>> hope someone can help with this,
>>
>> in my mysql table i''ve got a blob column storing images inside the
>> database, it''s also got the filetype and filesize.
>>
>> now i can work out what the filename will be (e.g. 2002.jpg) but i
>>
2006 Jul 26
1
mixing ebr and builder together and having it render as html in the browser
The first problem is that if you make a builder or .rxml file it always
displays as xml in a browser. declare! it and the browser gives and error
and if you change rxml to rhtml then it thinks you should be making erb. SO
quetion #1 is how do I make builder files render in the browser as html.
The next thing that I want to be able to do is be able to render parcials or
call other files of other
2006 Feb 27
0
when partial render is wider than the main part, scroll doesn''t appear on the browser!!!
Hi,
in my rhtml, I have two parts, the main part and a
partial, the main part has a width almost the same,
but
the partial is much longer and width. when it happens.
the vertical scroll appear correctly on the browser,
but the horizontal scroll doesn''t appear on the
browser, it appears instead on the partial render
part, so I have to scoll down until the end of the
partial, that use the
2007 Feb 22
0
error with send_file.. please help me...
Ben wrote:
> API is your friend.
> http://api.rubyonrails.org/classes/ActionController/Streaming.html#M000091
> send_file
I put this code block in files_controller.rb
def send_file(path, options = {}) #:doc:
raise MissingFile, "Cannot read file #{path}" unless
File.file?(path) and File.readable?(path)
options[:length] ||= File.size(path)
2014 Mar 26
0
Heroku | Rails 4 | Ruby 2.0 - send_file not presenting file for download in the browser
Hello all,
I am have an app that is hosted on heroku (rails 4 | ruby 2.0) that I am using paperclip-dropbox to upload attachments to a blog. I have created a download link for people who read the blog to be able to download the attachments but I am not able to get the file to actually download via the browser. I am curious if anyone knows what could be the issue.
My process is I download the
2006 Dec 01
1
Simple file download doesn't work - please help!
I need to get a simple file download to work.
I want users to be able to click ''I agree'' after scrolling through a
license agreement
and the click initiates a download of some software which is in a zip
file.
I tried using send_file and had some problems I previously posted
about. So I am trying
to not use send_file. (If anyone can help me with my previous send_file
post, that
2006 Nov 30
3
Strange send_file problem
Or perhaps I am stumbling in newbie fashion (tho I have active_merchant
and a store site basically up and running in development mode - still I
don''t feel I always understand what is going on.)
So, when I have
send_file(filename, :type => ''application/x-zip'')
redirect :action => index
the send_file seems to hang, rather than complete. I''m deducing
2006 Apr 27
4
pdf render inline .... update ''main'' div
Hi,
I want to keep the layout and just to a link_to_remote to update the=20
div id ''main''
Using this in the controller action
send_file "public/pdf/my.pdf", :type =3D> ''application/pdf'', =
:disposition=20
=3D> ''inline'', :stream =3D> false
I get this.
The raw pdf code sent replacing the main div with :
2007 Feb 23
1
How to make Rails send a file that is being written
I''m trying to build a simple proxy to Amazon S3 that would allow a
client to request a url that gets mapped to a S3 Object by Rails and
streamed back to the client.
For S3 integration, I use the highly recommended gem AWS::S3
(http://amazon.rubyforge.org/), and to send a file, I simply use the
send_file function.
The concept works BUT the I can''t get the file to be sent as
2006 Oct 25
7
Sending a file *and* rendering a page
Anyone know how to send a file/data to the user agent (download it)
using #send_file or #send_data, *and* render a new page in the same
action?
This just sends the file and doesn''t render the page:
def gimme
...
send_data(our_data, :filename => ''output.csv'', :disposition =>
''attachment'')
end
And this will give a Double-Render error:
2006 Sep 27
0
To render or redirect
Hi guys,
I have been using this code for a while and on the whole it works well.
# Display the search page
def search
@breadcrumb_title = ''Search''
if request.get?
@home_search = HomeSearch.new
else request.post?
@home_search = HomeSearch.new(params[:home_search])
@search_conditions = Home.search_homes(params).to_sql
if @home_search.valid?
2007 May 06
2
render :action "call method first?"
Hi,
I know when I call:
render :controller => ''some'', :action => ''thing''
It doesn''t call the method ''thing'' before render the template
''thing.rhtml'', but I need some instance variable which are in the
''thing'' method, how can I let it call the method ''thing'' and then render
2008 Feb 12
3
send_file - PDF
Hi-
I''d like to load a PDF file into a page, in my controller:
send_file "/path to/my.pdf", :disposition => "inline"
However, instead of rendering inline, it asks to download the file.
How can I display the contents without downloading?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
2006 Sep 26
0
Is it possible to render RXML partials in RHTML templates?
I have a RHTML template and I would like the output of a RXML partial to
be embedded within it.
When I do <%= render(:partial => ''list_edit'') %> where there exists a
_list_edit.rmxl file, I get XML parsing errors in the browser - I
believe because the partial is causing the rendered content to be
identified as XML instead of HTML.
Is there any way to
2006 Sep 02
1
html not rendering apache/mongrel
We are running Apache and Mongrel on RHEL4 and have been experiencing
some interesting behaivor. Sometimes when someone logs into our
application (it uses the acts_as_authencticaed and acl_system2) the
following happens. Instead of the browser rendering the html and
displaying all the form elements corretly as you would expect, it simple
spews back the output without attempting to render. So
2008 Jul 30
0
render :action apparently invalid
According to the output of my spec tests:
http://gist.github.com/3250
Using something like render :action => "edit" is now invalid... even
though when I do the action in the browser Rails complains of no such
thing. Rails and RSpec are at the latest versions and I''m at a
complete loss as to what the devil''s going on here! Any suggestions?
2006 Apr 11
0
Tab browser
Hi everybody,
I''m an ajax newbie.
I''m developing on Catalyst ( yes, I know... ;) ) a
tabbed-content-browser
for managing products ( modify, sort, delete and so on).
The matter is that when I switch from a tab to an other, sorting and
inplace editors don''t work anymore. Since I have many fields to
re-enable, is there a rapid way to do it?
The functions to enable them