similar to: Generating file for download from controller method on demand

Displaying 20 results from an estimated 20000 matches similar to: "Generating file for download from controller method on demand"

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
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'',
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 =>
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
2006 Apr 12
9
Showing Images from a file store
Hi all. I am wrting a small content management tool for my company and was trying to display some images from our file store shown below. <td> <img src="\\xx.xx.xxx.xx\xx\xx\xxx\abc.gif"/> The app was displaying the image when it is under the \public\images directory. Is there anything special we need to do to get a file from outside the root of the application? Any help
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 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 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 =>
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
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 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
2006 Jun 16
10
Issue with caching of .PNG files in IE..
I''m running a Rails application with WEBrick server. We are displaying an Image from the server to the Client (Browser). First time on the browser everything looks fine, upon clicking the link, it contacts the server and displays in IE brwoser the image that was stored on the server. But in case if the image gets changed on the server(File Name being the same), then even though i
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
2013 Jan 13
0
[LLVMdev] Obsolete PTX is NOT completely removed in 3.2 release
Anton, > Pawel, > > We all understand that you're pretty new to release process, etc., but > I think you should understand the implications of your actions. > > You just created a lot of harm for really huge pile of users - the > ones who downloads the tarball via some automated build system and > rely on the known good checksum. This includes, but not limited to to
2006 Dec 30
2
Another RSpec on Rails issue: how to test send_file()
Hi! Today I needed to implement some controller code, that uses send_file() to send image data. How can this be tested / specified with RSpec? bye, Tobias
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 :
2010 Jan 03
2
Problem with downloading a generated Excel sheet
Hello, I''m using the spreadsheet/excel gem to generate an excel sheet that I want user to be able to download it once it''s generated. Please take a look on the below code: @contacts=Contact.find(:all) if @contacts.size>0 file="#{Date.today}_Report.xls" workbook=Spreadsheet::Excel.new("#{RAILS_ROOT}/public/reports/#{file}")
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
2013 Jan 13
2
[LLVMdev] Obsolete PTX is NOT completely removed in 3.2 release
Pawel, First, all your help with the 3.2 release is greatly appreciated. I do not think anyone is saying otherwise. I apologize for the lack of documentation regarding this issue. I do ask that you consult with previous release manager (myself or Bill) to determine what the best course of action is. There is a lot of room to improve our release process, but its a collaborative effort. You are
2006 May 14
3
send_file and locking files after download?
Hello, I''m working on a download service which grants users a one-time-download access to files. The idea is to write an entry to a database table after a successful download that "locks" the download link for the user. After doing some quick tests with send_file I noticed that send_file does not block until the user has downloaded the full file, but proceeds with the