similar to: send_data always sends xml file?

Displaying 20 results from an estimated 20000 matches similar to: "send_data always sends xml file?"

2008 Oct 27
8
why can't johnny download?
I''m working on an app that includes the feature to allow user to download a csv file of their data. I''ve got it working on my local machine, but when I deploy it, the link I''m making doesn''t work for doing the download. The file IS being created in the location I''m intending, but the file download only works on my local machine and not on the server.
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
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 =>
2010 Feb 24
6
Yet another send_data :image question...
Guys & gals, I''m also learning RoR (using v2.3.4). I''ve got a basic scaffold working for image file creation, and - to a point - image file display. The send_data function is working in my controller - no problem. The model code is able to parse the uploaded file construct too. def show @image = Image.find(params[:id]) send_data(@image.binary_data, :type =>
2010 Dec 22
0
image_tag and send_data
i''m storing images in database. i have this action in controller: def image begin item = StoredItem.find(:first, :conditions => {:id => params[:id]}) rescue return end return if item.nil? if item.image_binary.nil? render :nothing => true else send_data(item.image_binary, :type => item.image_datatype, :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
2012 Apr 27
4
Is my developer dodgy?
Hi! I need some help, my partner and I have hired an app development company to create an iPhone app that allows shops to list their inventory and advertise their specials, there is also a back end admin website that shop owners can login to that allows them to update their inventory and specials. The admin website communicates directly with the iPhone app so that any changes made are shown on
2006 Nov 04
0
send_data from disk
Hi, I''m trying to use send_data to stream a file that is stored on my disk (not as a blob in the database.) So, this is what I''ve tried: send_data File.new(filename).read But, the file doesn''t download. I think send_data expects something other than a String (which is returned by File.read.) Anyone know how to get this working? The reason this is being done is to
2009 Nov 08
2
send_data with jpeg not working
I''m a newbie having trouble using send_data to send a jpeg file to the browser for display in an html img tag. This is the relevant code from my controller (photos_controller.rb): def retrieve @photo = Photo.find(params[:id]) send_data File.read(@photo.abs_img_path), :type => "image/ jpeg", :disposition => "inline" end def download @photo =
2006 May 22
2
Problem with send_data and csv file produced
hi, i did a search and couldn''t find wat''s the problem with my code... it seems everything is the same and the result is what i expected but i am not sure where went wrong.... using send_data function to send the csv file to the client, the file sending is successfully but when i opened the csv file, something is wrong... every statement got a "......" inverted
2006 Jul 07
3
quick send_data question...
Hi, I am using send_data to allow users to download files from the database but ran into a small problem, it seems that files upload fine but when they download only 64kb of the file is sent. I''m using the basic rails code from the Agile book: #upload code in my sheet model def file=(document_field) self.filename = base_part_of(document_field.original_filename)
2006 May 17
0
send_data not working properly with link_remote_to
I''m reading an image in an link_to_remote call,and then using send_data i send the read image as :type => "image/png" :disposition => "inline"...but when the div tag gets updated i see only ascii characters .....but if i do the same operation using normal call(link_to) i see it functioning normal ....could someone explain . my view: <%=
2007 Jul 24
0
send_data and ie
Has anyone else had trouble using send_data with internet explorer. As usual things were working fine in firefox and safari until I tested in IE :). With the following code I''m seeing an image show up in firefox but the "X" indicating no image found in IE. Any ideas? @image_data = Image.find(:all, :conditions=>{:url => "http://reddit.com"}) @image =
2006 Jan 09
6
Rendering dynamic Gruff image (send_data)
Dears, Got a controller witch do a send_data for displaying a chart. like : send_data(g.to_blob, :filename => "any.png", :type => ''image/png'', :disposition=> ''inline'') I actually do a <img src="http://myhost:3000/stats/make_graph" /> Is there any way more clean to do that ? At minima don''t hardcode the beginning
2006 Sep 12
2
Generate JS from RoR - strange delay with send_data
Hi! I need to generate some JS from Ruby. This is no AJAX related stuff so RJS templates are not help to me. Also I want to not mix JS with HTML, so putting JS in .rhtml templates is no go for me. Currently I made some action in controller, prepared JS code and I''m sending it via send_data as ''text/javascript''. In .rhtml templates I use <script> tag with src
2006 Jul 05
1
send_data image
I''m trying to display an image in a view from MySQL, but I''m not sure where to put the send_data call. Any help would be great. :) -- Posted via http://www.ruby-forum.com/.
2008 Apr 15
4
trouble streaming images with send_data
Hi I''m doing some server-side graphics with Java2D and I''m trying to stream the resulting image to the browser using send_data. When I try to view the image that I streamed, the browser just shows the URL in the window as a very small image (about .4 kb) when I am using jpeg format. For png, it tells me that the image has errors and can''t load it. Here''s what
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------------------------------------------
2009 Dec 24
2
Showing graphs on browser with gruff lib.
Hi, I am using "gruff" lib for creating the graphs. I have got the success to create the graph, but my problem is I don''t want to store it, I want that they should be displyed on the browser it self. I have tried this:- " send_data(g.to_blob, :disposition => ''inline'', :type => ''image/png'', :filename =>
2008 Feb 11
0
send_data problem
Hi! Following call for sending data does not sets the HTTP Content-Type header under Rails 2.02: send_data(csv_string,:filename => @entity.name+".csv", :type => ''text/ csv; charset=UTF-8'') Can anyone help why its happening? Regards, Mohsin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google