search for: content_typ

Displaying 20 results from an estimated 282 matches for "content_typ".

Did you mean: content_type
2008 Sep 02
2
Actionmailer - Multipart and Outlook?
...Actionmailer. Problem: Emails that I send with plain text, rich text, and attachments do not display the same results across GMail, Yahoo, Outlook and Thunderbird. Scenario: I am sending an email with text/plain, text/html, and 2 attachments using the code below, and I''ve specified the content_type. GMail receives and displays the email perfectly but in outlook, none of the attachments are displayed, and in thunderbird, the last attachment is displayed, and in yahoo, none of the attachments display. I''ve followed many tutorials including the guide in the actionmailer main doc. th...
2007 Apr 27
3
attachment_fu content_type problem
...ew to Rails and trying to find my way but I''m having an issue with uploading documents with attachment_fu. I have a form where I''m uploading multiple attachments (using AJAX to add file_filed_tags). That seems to work pretty well. The problem is I can''t seem to get the content_type to work as I would expect. For example, if I use this: has_attachment :content_type => [''application/pdf'', ''application/ msword'', ''text/plain''] I would expect I can upload .pdf, .doc and .txt files but I get and Document is invalid error...
2007 Jul 04
2
content_type from a local file?
I''m using a Rake task to add local files into a database designed for use with attachment_fu. http://eldorado.googlecode.com/svn/trunk/db/migrate/039_create_avatars.rb http://eldorado.googlecode.com/svn/trunk/lib/tasks/import_files.rake So, attachment_fu has a "content_type" field, which apparently is receiving that information from the browser...? I''m trying to figure out if there is a way to get the content_type of a file (e.g. ''image/png'') that you''ve already got in your file-system. I can''t find anything about th...
2006 May 05
5
Attach a PDF File to an Email
Hello ~ I have an email that I need to attach a PDF to. The email is being sent, and a file is attached but it is not the original file. I am following the example: attachment :content_type => "image/jpeg", :body => File.read("an-image.jpg") changing it to: attachment :content_type => "application/pdf", :body => File.read("pdf/my.pdf") There is also this example: attachment "application/pdf" do |a| a.body = get_p...
2007 Mar 11
4
Faking it... import local files into attachment_fu
...r''s file system. So far, I''ve been able to copy to an instance of Tempfile via the copy_to_temp_file method I jacked from attachment_fu and pass that as the value of :uploaded_data, but attachment_fu is still not happy. The Tempfile created via a multipart form and a browser has content_type set, as well as having the path be how the object is identified (i.e. - #<File:/tmp/file/path>). I feel like I''ve either reached a dead end and I have to explore setting size, original_filename, and content_type explicitly in the new method parameters or that I''m just bump...
2007 Dec 31
3
undefined method `content_type'
I am using form_remote_tag to upload a file, but it says .. undefined method `content_type'' for #<String:0x477a930> what could be wrong when it works fine with form_for? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"...
2008 Jun 15
11
Ouch! Can't figure out this file upload issue...
...re.save redirect_to(:action=>''show'', :id=> @picture.id) else render(:action=> :get) end end def picture @picture=Picture.find(params[:id]) send_data(@picture.data, :filename=>@picture.name, :type=>@picture.content_type, :disposition=>"inline") end def show @picture=Picture.find(params[:id]) end Views: For Get-- <h1>Upload Image File</h1> <% form_for(:picture, :url=> {:action=>''save''}, :html=> { :multipart=&g...
2009 Oct 28
2
How to send a html email with attachment
...;','') @recipients = address @from = "Chronos weekly report <chronos-4ZJPdxLVsvDgESyFIoI21jfzStP7pjZN0E9HWUfgJXw@public.gmane.org>" @subject = "[Chronos] Weekly report" @sent_on = Time.zone.now @body[:projects] = Project.all attachment :content_type => "image/png", :body => File.read(RAILS_ROOT + "/public/images/cancel.png") end views: just a erb file. and the way I sent the mail is like below: mail = MailReport.create_weekly_report mail.set_content_type("text/html") MailReport.deliver(mail)...
2006 Jan 05
4
testing file uploads
Hi all, I was wondering about the class used when rails receives file uploads. Sometimes it appears to be a File, and other times it is a StringIO. Also it has methods such as original_filename that don''t appear to belong to either of these classes. I ask because I''m trying to work out how to test my fil upload related models and controllers. Is there some standardised way of
2007 Aug 03
6
Problems saving an uploaded image to an app folder
...39;m doing wrong here? (i''ve just enclosed the model methods as all the controller does is call ''write_to_disc'' on my picture instance): #in class Picture attr_accessor :file_data def picture_file=(input_data) self.filename = input_data.original_filename self.content_type = input_data.content_type.chomp self.file_data = input_data.read end def write_to_disc #save the picture to newspipe/data/pictures with the name ''#{self.id}.extension'' new_filename = "#{self.id}.#{self.content_type.split("/").last}" if sel...
2008 Jan 11
3
Date range queries return zero results
...ges to work correctly. I am using the following command to load the db: index << {:title => row[7].to_i, :date => Date.strptime(row[3], ''%Y-%m-%d''), :page_id => row[5].to_i, :page => row[6].to_i, :content_type => row[1].to_i, :article_id => row[4].to_i, :label => row[2], :label_sort => row[8], :content => row[0] } Notice "Date.strptime(row[3], ''%Y-%m-%d'')"... When I query (ex. +lab...
2007 Aug 22
8
How to spec an attachment_fu model
...lt;%= submit_tag :Save %> # <% end -%> # # @attachment = Attachment.create! params[:attachment] # # TODO: Allow it to work with Merb tempfiles too. def uploaded_data=(file_data) return nil if file_data.nil? || file_data.size == 0 self.content_type = file_data.content_type self.filename = file_data.original_filename if respond_to?(:filename) if file_data.is_a?(StringIO) file_data.rewind self.temp_data = file_data.read else self.temp_path = file_data.path end end While...
2006 Nov 20
7
Acts as attachement
Hi guys Question about acts as attachment still getting the following error undefined method `content_type'' I have set everything up according to the following page however i am still have trouble http://weblog.techno-weenie.net/articles/acts_as_attachment One thing, I have wanted to add this to an existing model in my system. I have not used the... script/generate attachment_model dvd_...
2009 Nov 04
11
Sending Mails with mutations ä,ü,ö
Hi everyone I am sending mails with rails in German. The Problem is that the German letters ä,ü,ö are arriving correctly at the receiver. When the subject contains the word Für the receiver gets Für Does anybody knows this issue? Thanks in advance. Adam -- Posted via http://www.ruby-forum.com/.
2006 Mar 04
13
file_column
Restricting size of an uploaded file, is how is that possible? If I do not want a user to upload a file larger than X bytes, can it easily be done? If I also would like restrict the types of files that can be uploaded, how may I do so? Thank you, Sharkie
2006 Apr 13
2
Content-type on render :file
Hi all, I''ve just been trying out the dirt-simple rcss scheme posted here: http://blog.hasmanythrough.com/articles/2006/03/23/dirt-simple-rcss-templates It looks like the content-type declaration on the line: render :file => file_name, :content_type => ''text/css'' isn''t getting honoured. I had to add a separate: @headers[''Content-type''] => ''text/css'' for it not to be received as text/html. Is this a known problem, or did I screw something up? I''ve got an app t...
2006 Mar 01
0
Possible bug in ActionMailer (with patch)
...t with the :headers parameter. class ArticleMailer < ActionMailer::Base def test_message subject ''This is a test'' recipients ''elan@bluemandrill.com'' from ''Exemplary Products <info@example.com>'' content_type ''multipart/related'' part :content_type => ''text/html'', :body => ''Before <img src="cid:test@test.com"> After'' part :content_type => ''image/png'', :content_disposition =>...
2011 Sep 25
0
paperclip content_type error
Hi all, I am using rails 3.1 with paperclip. when I try to upload a picture of type ''jpeg''. picture_content_type value not a image/jpeg. It is storing some Xadsfdsfdasfc value. I dont get the problem. can you help me. thanks, Aashish -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to thi...
2006 Sep 19
9
Very strange: Umlauts (äöü) aren't displayed correctly in
Hi all Take a look at the following video, please... I just'' can''t help me anymore... http://josh.ch/files/temp/rails_problem.mov I''m sorry for the bad quality, it''s just a demo of Snapz Pro X 2... ;-) But I hope you''ll see enought... Thanks for any help. Josh -- Posted via http://www.ruby-forum.com/.
2008 Apr 25
1
attachment_fu and mime type issues
Hi All, I am having a problem with the attachment_fu plugin and flac audio files. In the dev environment, using mongrel, the form upload object does not seem to have any associated content_type. I get the following attachment_fu validation error: "Content type can''t be blank". I don''t understand why the file_data would not have any content_type. Doesn''t rails set the content type based on the mime type? How is it that a file can be uploaded without an...