Displaying 20 results from an estimated 50000 matches similar to: "read the pdf"
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
2007 Apr 23
4
send_file pdf problem
Hi,
I am using send_file to allow users to download files from my website,
please see code beloe:
def download_document
send_file("#{RAILS_ROOT}/public/test_form.pdf",
:filename => "test.pdf",
:type => ''application/pdf'',
:disposition => ''attachment'',
:streaming
2007 Feb 28
8
Export/save csv-file to desktop of user?
Hi,
looking for something that simple, but can''t find it. I got:
outfile = File.open(''teams.txt'', ''wb'')
CSV::Writer.generate(outfile) do |csv|
for team in @teams
csv << [team.id, team.name]
end
end
outfile.close
send_file "teams.txt", :filename => "teams.txt",:disposition =>
2007 Aug 27
1
Send_file() method for downloading any file
HI,
I need to know how to download any file using send_file() method.The
code I have shown below is for a specific file........how ever I need it
for any file.
THE CODE
........
def download_files
send_file(''D:/hr/Handbook.doc'',
:filename => params[:filename] ,
:type => ''application/octet-stream'',
2011 Jul 24
4
Downloading files not stored in database?
Hello list,
I am trying to add functionality to my application that will allow users
to download files that are not stored in a database.
All the examples I have found find the file by ID. which I can not do.
Here is my code from the view:
<h1>Browse files for download</h1>
<% form_for(:download, :url=>{ :controller=>"download",
2007 Mar 16
7
how to send mp3 inline?
hey all,
I''m trying to do a:
send_file @file, :type => ''audio/mp3'', :disposition => ''inline'' ,:stream=>true
I tried with all browsers and it always asks me to download the file
or open it with a player. Is there a way to make it open in the
embeded player (QT,Windows media player,Mplayer etc)? Only with
konqueror if I open in new tab then I
2007 Aug 27
2
send_file : downloaded file cannot be open after upload OK
I easily implemented the upload , using the ''attachment_fu'' plugin...
I can see and open the uploaded files (a pdf file 60k and a jpeg images
28k)
now I try to implement the download action in my document_controller, I
wrote :
def download
@document = Document.find(params[:id])
send_file(@document.full_filename,
:filename =>
2006 Aug 08
2
send_file problem
I''m attempting to use send_file to send an image file from
public/images. The file is world readable.
I keep getting the following error:
A ActionController::MissingFile occurred in account#current_logo:
Cannot read file public/images/logo.png
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/streaming.rb:55:in
`send_file''
I''ve tried supplying
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 Nov 07
2
Setting headers in sent_file response
I''m having trouble playing a video from my site on the iphone using
send_file. It seems that I''m missing the Accept-Ranges header in my
response. How can I set the Accept-Ranges header in my send_file
response?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2007 Aug 24
1
How to download any file using send_file() method
HI,
I am directory listing and in that listing I have certain files and sub
directories, now when I click on the files it should download that
particular file but I am not able to accomplish it, and I have got to
use send_file() method.
In the send file Code shown below I have made use of the address of one
of the files directly so when I click the link of any file it downloads
it.
THE CODE
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:
2007 Feb 27
2
send_file and ZIP files
I have an application which uses send_file to send a ZIP file to the
client. This works nicely when it''s run on our development OS-X
boxes, using mongrel from script/server, but on our production
server, using mongrel behind Apache 2.2. with mod_proxy_balancer, the
client gets 1 byte delivered :-(
If I use wget -S to the URL in order to see the full headers I see
this on
2007 Jun 07
6
Can't download files with send_data or send_file
I have a form_remote_tag that calls a method to print out a csv file
for download. If I tell the form_remote_tag to update a div the data
comes up in that div, but otherwise I can''t get the browser to
acknowledge the sent file.
>From view:
<%= form_remote_tag :url => {:action => "csv_dump" }%>
<%= submit_tag "Download Complete List" ,:name
2010 Nov 03
2
send_file but not send_data?
So this is the original code I used, and it worked
send_file ''vendor/sprites/not-found.png'', {:filename =>
"sprite-not-found.png", :type => "image/png", :disposition => "inline"}
Now I switched it to this (going to be adding imageMagick)
send_data File.read(''vendor/sprites/not-found.png''), {:filename =>
2006 Feb 28
1
ArgumentError (string contains null byte) -- file upload problem
Hi,
Controller code:
if params[:main_image]
image = Image.new
image.blob = params[:main_image].read
@product.main_image.destroy if @product.main_image
@product.main_image = image
end
When I try to display the image using send_data, I get the following error:
ArgumentError (string contains null byte):
2006 Apr 05
1
send_file VS. send_data (performance)
Does anybody know if there is a big performance/time cost difference
between these two methods of serving a file:
------------------------------- #1
-----------------------------------------
send_file "test.png", :type => ''image/png'', :disposition => ''inline''
-------------------------------
#2------------------------------------------
2007 Jan 08
1
delete a file from the server
Hi all,
i want to create a vcs file. when i am creating the vcs file it is
getting creatd in the server as well as in the local drive. But i dont
want to the vcs file to be saved in the serve. when i am trying to
delete the file from the server it is throwing the error,"Cannot start
Microsoft Outlook.Cannot import vCalendar file". here is the code that i
am using.
def vcs
f =
2006 Jul 07
3
Send a 30 Second Clip of an mp3
On my site I''m allowing users to upload songs in mp3 format. Members
can download the full song, but on public pages I would like to use a
flash player to play a 30 second clip of the song and/or allow
downloading of a 30 second mp3 snippet. The songs are stored above the
web root directory, and I use the send_file method for the full file
downloads for members.
My question is,
2011 Jan 13
2
send_file works on Rails2,SSL - except for IE7/6
Quirky stuff here,
The current setup works fine for Firefox 3.6 and IE 8 but balks on
earlier IEs. The files are PDFs, .doc files, and other binaries but up
to several MB:
A. the users'' problem is a minor IE7 quirk: it works to download files
from clicking links, but if you use the URL instead then the browser
stops after a fraction of a second. Refreshing or hitting Return again