similar to: ArgumentError (string contains null byte) -- file upload problem

Displaying 20 results from an estimated 3000 matches similar to: "ArgumentError (string contains null byte) -- file upload problem"

2007 Apr 19
2
invalid geometry string in change_geometry
I get the following error at the browser: ArgumentError in ImagesController#upload invalid geometry string `110×'' ... for the call to change_geometry with an explicit size (''110x'') as the geometry string: def make_thumb (the_img) require ''RMagick'' size = "110x" debugger if ENV[''RAILS_ENV''] ==
2010 May 03
7
rendering images dynamically
Hi, I have a rails application where I respond to a request by fetching image urls from various web api calls and need to display them as they come available. I am able to display all the images once I get them all, but that causes an unacceptable delay for my user. One approach I am trying is, from my controller, set an @image variable, and then pass in a block to the model that retrieves the
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 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
2006 Feb 28
1
adding to errors in controller?
def update @product = Product.find(params[:id]) @product.attributes = params[:product] if params[:main_image] image = Image.new params[:main_image] if image.save @product.main_image.destroy if @product.main_image @product.main_image = image else @product.errors.add_to_base(image.errors.full_messages.join(", ")) end end
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",
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
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
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:
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 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 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------------------------------------------
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,
2006 Apr 06
1
Rmagick file conversion
I am using rmagick to convert files stored as a tiff to either pdf or jpg for display to the user. A snippet of test code from the controller follows. It works OK. ( it does need a sanitizer ) require RMagick def pdf @sdoc = Sdoc.find(params[:id]) @fname = ''/var/www/images/'' + @sdoc.fname @nf = Magick::ImageList.new(@fname)
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 =>
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
2006 Dec 15
6
RMagick=bad, ???=good
I know that Zed has made mention of the fact that using RMagick with mongrel and rails is a bad thing. I''m currently using FlexImage (which in turn uses RMagick) on my application and really haven''t had too many problems. We get a restart for memory usage every 8-10 hours on one mongrel of twelve running, but I''m not sure if that''s an RMagick issue. Either way,
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 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
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