similar to: Simple file download doesn't work - please help!

Displaying 20 results from an estimated 6000 matches similar to: "Simple file download doesn't work - please help!"

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
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
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
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 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
2004 Dec 20
1
HP-UX/AIX sendfile patches.
I have a fix for the sendfile.c code for HP-UX - length not properly specified prior to call. I've also added code to support the AIX send_file() function and configure.in code to check for AIX specific send_file API and sets AIX_SENDFILE_API if successful. Could you consider this patch for 3.0.11? I also sent a web/cgi.c patch for "struct var" last week with respect to compile
2005 Dec 13
3
send_file doesn't work with Apache?...
Hi, I''ve been using send_file in my Rails application with WEBrick happily to send files of various sizes and kinds. The same code fails to send anything but a 500 error when run under Apache, and a log file message "warning: syswrite for buffered IO". Looking back through the mailing list archives I see that there have been send_file bugs in the past. Can some knowledgeable
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 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'',
2009 Mar 26
2
Deleting files after they are sent via send_file
Hello guys, I am having the option to download certain folders on my app in zip format. So every time a user requests one I''m doing a system call to zip the folder (ex: system(''cd ''+path+'' && zip ...) and then the send_file method to send it. What happens is that I''m keeping track of disk space so I need to delete the zip immediately. I was
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 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 Dec 17
2
Error in send_file
I''m trying to add a link to download a zip file. I created a controller method that makes the call to send_file: def getzip send_file ''file.zip'' end When I navigate to this link I get a MissingFile exception. The file definitely exists (and U triple-checked paths and spelling) and the permissions are 644. I tried moving it to the /public folder and updating the
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 Dec 21
6
Rails'' send_file, Mongrel, and *gasp* memory
I''ve had a right fun few days at work trying to figure out why our Rails app (which isn''t under very heavy load) kept eating memory and bringing our server to our knees. Eventually I traced it to send_file (which was in a way a relief as it wasn''t down to my coding ;) -- every time a user started downloading, the memory consumed by the app would jump, and
2012 May 31
2
send_data/send_file does not open a save as dialog box
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 client side save as dialog is never opening for the user to receive
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
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",
2006 Jan 12
2
ActionController#send_file
Looking at the code for ActionController#send_file I see that it is using ruby to send the file contents. Linux supports a sendfile() OS call. The implementation of Linux sendfile() is extremely fast and very CPU efficient, far faster than what can be done in user space. Does Windows support a sendfile() equivalent call? I haven''t been working with ruby long enough to know how it handles
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 =>