<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: new rails plugin: mimetype_fu</title>
	<atom:link href="http://railsontherun.com/2007/06/14/new-rails-plugin-mimetype_fu/feed/" rel="self" type="application/rss+xml" />
	<link>http://railsontherun.com/2007/06/14/new-rails-plugin-mimetype_fu/</link>
	<description>Rails experiments by Matt Aimonetti</description>
	<lastBuildDate>Tue, 23 Feb 2010 22:05:18 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jeff</title>
		<link>http://railsontherun.com/2007/06/14/new-rails-plugin-mimetype_fu/comment-page-1/#comment-1389</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Thu, 14 Jun 2007 04:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://railsontherun.com/2007/06/14/new-rails-plugin-mimetype_fu#comment-1389</guid>
		<description>Wish I had stumbled upon your plugin before I began hacking attachment_fu to do the same thing for patronsocialclub.com.  I ended up changing the uploaded_data function to look for Flash&#039;s bogus &quot;application/octet-stream&quot; content-type and returning the correct type using:

      def determine_content_type(filename)
        extension=filename.split(&#039;.&#039;).last.downcase
        mime_mappings = {
          &quot;jpg&quot;   =&gt;    &quot;image/jpeg&quot;,
          &quot;jpeg&quot;  =&gt;    &quot;image/jpeg&quot;,
          &quot;gif&quot;   =&gt;    &quot;image/gif&quot;,
          &quot;png&quot;   =&gt;    &quot;image/png&quot;,
          &quot;zip&quot;   =&gt;    &quot;application/zip&quot;
        }
        return mime_mappings[extension]
      end

I&#039;m still having trouble getting Flash file uploads to work on OSX.  They work fine on a PC.  I ran across this blog post but am not sure its the same issue (http://www.oscartrelles.com/archives/filereference_bug_in_flash_player_9_for_mac_os).

Speaking of Flash and Rails, I ran across WebORB this morning.  It suppports Flex RPC calls.  I blogged about it at jeffontech.vox.com.  Thanks for your plugin.  I can&#039;t wait to try it out.

Cheers,

J.</description>
		<content:encoded><![CDATA[<p>Wish I had stumbled upon your plugin before I began hacking attachment_fu to do the same thing for patronsocialclub.com.  I ended up changing the uploaded_data function to look for Flash&#8217;s bogus &quot;application/octet-stream&quot; content-type and returning the correct type using:</p>
<p>      def determine_content_type(filename)<br />
        extension=filename.split(&#8216;.&#8217;).last.downcase<br />
        mime_mappings = {<br />
          &quot;jpg&quot;   =&gt;    &quot;image/jpeg&quot;,<br />
          &quot;jpeg&quot;  =&gt;    &quot;image/jpeg&quot;,<br />
          &quot;gif&quot;   =&gt;    &quot;image/gif&quot;,<br />
          &quot;png&quot;   =&gt;    &quot;image/png&quot;,<br />
          &quot;zip&quot;   =&gt;    &quot;application/zip&quot;<br />
        }<br />
        return mime_mappings[extension]<br />
      end</p>
<p>I&#8217;m still having trouble getting Flash file uploads to work on OSX.  They work fine on a PC.  I ran across this blog post but am not sure its the same issue (<a href="http://www.oscartrelles.com/archives/filereference_bug_in_flash_player_9_for_mac_os" rel="nofollow">http://www.oscartrelles.com/archives/filereference_bug_in_flash_player_9_for_mac_os</a>).</p>
<p>Speaking of Flash and Rails, I ran across WebORB this morning.  It suppports Flex RPC calls.  I blogged about it at jeffontech.vox.com.  Thanks for your plugin.  I can&#8217;t wait to try it out.</p>
<p>Cheers,</p>
<p>J.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://railsontherun.com/2007/06/14/new-rails-plugin-mimetype_fu/comment-page-1/#comment-1390</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Thu, 14 Jun 2007 04:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://railsontherun.com/2007/06/14/new-rails-plugin-mimetype_fu#comment-1390</guid>
		<description>I&#039;ve been working on a flash photo upload application using attachment_fu and swfupload and run into the mimetype problem.

Replacing in attachment_fu.fb,
&lt;pre&gt;
self.content_type = file_data.content_type
&lt;/pre&gt;

with
&lt;pre&gt;
self.content_type = !(file_data.content_type.strip == &quot;application/octet-stream&quot;) ? file_data.content_type : File.mime_type?(file_data.original_filename)
&lt;/pre&gt;

does the job perfectly.

Thanks for your plugin. Saved me lots of times.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been working on a flash photo upload application using attachment_fu and swfupload and run into the mimetype problem.</p>
<p>Replacing in attachment_fu.fb,<br />
&lt;pre&gt;<br />
self.content_type = file_data.content_type<br />
&lt;/pre&gt;</p>
<p>with<br />
&lt;pre&gt;<br />
self.content_type = !(file_data.content_type.strip == &quot;application/octet-stream&quot;) ? file_data.content_type : File.mime_type?(file_data.original_filename)<br />
&lt;/pre&gt;</p>
<p>does the job perfectly.</p>
<p>Thanks for your plugin. Saved me lots of times.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
