similar to: Copying a file from a URL to local machine.

Displaying 20 results from an estimated 3000 matches similar to: "Copying a file from a URL to local machine."

2006 May 23
4
''key not found'' problem with saving model object.
Hello, I have the following structure: model foo has_many :bars:, :dependent => true end model bar belongs_to :foo end In my action, when i try to save foo: def save begin f = foo.new f.a = 5 begin b = bar.new b.a = 10 f.bars << b rescue Exception => exc ... end f.save! <-- This does not happen
2006 May 16
4
question about strftime when called from partial.
Hi, I''m calling a helper I''ve written - format_time() that is called from my views with a given time that was selected from my database and was returned to the view via an instance variable. When I call format_time from a partial, I see that I get some kind of String error and the partial won''t render. Basically, the object being passed in to format_time is already a
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
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 12
6
Cannot send_file then delete it
My application accepts a form to create multiple large(100''s of MB) temporary files and then zip''s them up to send off to a user. I have the files constructed, and the zipping working. The problem is that if I use send_file to send the zip off to the user, I cannot delete the file afterwards as it seems send_file forks off another process and deletes the file before the
2013 Feb 25
4
mixing MX and CNAME
Hi, Has any one had problems with mail clients were your DNS is like this; doman.com MX 50 mail.domain.com domain.com MX 100 mail2.domain.com domain.com CNAME www.domain.com -aurf
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 Jan 11
6
Output non-HTML (CSV) from Rails
Hi, I want to offer a CSV download of data in my Rails app (eg. An "Export to Excel" link to grab the current view of tabulated data). However, I can''t seem to break-out of the Rails framework to output this non-HTML data. Even if I eliminate my layout template from my view, the most basic view (no HTML) will still wrap the output in
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 May 30
3
expected, got Fixnum problem.
Hi, I was wondering if anybody knew what ''<some type> expected, got Fixnum'' means? My code looks like the following: begin anevent = Event.new anevent.title = params["event"]["title"] anevent = session[:user_id] com = Community.find(params[:id]) com.events << anevent rescue Exception => exc ... end But I get an
2006 Jan 04
4
How to open a pdf file in new window
Hi all I made a pdf file in ruby and to display it used the method send_data like # send_data pdf.render, :filename => "Hello.pdf",:type => "application/pdf" # Now I want to open it in another window or as a popup. How can I achieve it? Thanks to all. Sainaba. -- Posted via http://www.ruby-forum.com/.
2009 Mar 14
2
Rails, lighttpd and the Expires header
I have a controller that serves up images from a different location from /public/images/ by using send_file or send_data on /media/thumbs/ 38 for example In lighttpd I have: expire.url = ( "/media/" => "access 10 years", "/stylesheets/" => "access 10 years" , "/javascripts/" => "access 10 years",
2010 Apr 29
2
send_data => invalid byte sequence in US-ASCII
I''m trying to display a generated .png plot via send_data(), but it results in a server error "invalid byte sequence in US-ASCII" error. I''m pretty sure this means that I need to specify the encoding somewhere, but I haven''t been able to figure out where or how to do so. Some particulars: I''m running gnuplot through a pipe to generate a plot in .png
2019 May 16
2
SRV records.
Hi all, A slightly hypothetical one here... but after Samba (Winbind actually)... looks up the list of AD server for a doman from DNS... what method does it use to decide which is the correct (most local?) domain controller to connect to/log in to? What will it's behaviour be if it connects to one, or two which don't have connectivity. -- A. James Lewis (james at fsck.co.uk
2006 Jun 06
9
How to protect images from public?
Hi, I''m trying to figure out the best way to protect images uploaded by users who may wish to keep them private. For example, if they are uploaded in the default file_column location (/public/blah/blah/1/) then someone can simply type the URL http://www.blah.com/blah/blah/1 and get the image. I can store the images in a non-public directory in the rails app (ie: /railsapp/images/X/)
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 Jun 06
4
Checking if a directory is empty using File
Hi, I have one minor issue. I''m trying to check whether a directory is empty given some path to the directory. My code does the following: if(File.directory?(dirpath)) # dirpath = public/images/1 if(File.zero?(dirpath)) FileUtils.rm_rf(dirpath) end end The problem is, while testing this, if I put a file in the directory and run the above code, it still ends up deleting the
2012 Sep 24
3
Winbind issue using samba 3.6.3
We have a cross platform environment with a Windows 2008 server running Active Directory and many of our workstations are running ubuntu 10.10 using winbind for user authentication. The version of samba running on these boxes is 3.5.4 We are looking to upgrade to Ubuntu 12.04 which runs samba 3.6.3 I am able to connect to the DC, and am able to see the users running the wbinfo -u command, but
2006 Feb 21
5
ffmpeg/ffmpeg2theora &vhooks
Hi theora-list, I'm involved in in a project to redistribute C-SPAN's floor footage from the US house and senate that we're capturing and converting*. This footage is in the public doman, however there's a C-SPAN overlay which is a registered trademark - we're having to overlay a "public domain" graphic on top of it. We're currently doing this with
2004 Jul 14
2
Authentication Problems.
Hey- I'm kinda new to Dovecot and I'm trying to do something and it seems I've hit a wall. I put together a server with Fedora Core 2, Exim 4.34, and Dovecot 0.99.10.6 and I need support mail for multiple domains so this is how I have my virtual setup: Virtual Aliases Files: /var/virtualdomains/$domain/etc/aliases Virtual Accounts Passwd File: