<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/2.4.0-rc2" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Brian's Tech Blog - Latest comments on File upload in Rails</title>
		<link>http://briansblog.net/blog1.php?disp=comments</link>
		<description></description>
		<language>en-US</language>
		<docs>http://backend.userland.com/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=2.4.0-rc2"/>
		<ttl>60</ttl>
				<item>
			<title>In response to: File upload in Rails</title>
			<pubDate>Wed, 22 Apr 2009 13:02:28 +0000</pubDate>
			<dc:creator>sack [Visitor]</dc:creator>
			<guid isPermaLink="false">c81@http://briansblog.net/</guid>
			<description>you should append the following line to the end of the solution:&lt;br /&gt;
tempfile.rewind</description>
			<content:encoded><![CDATA[you should append the following line to the end of the solution:<br />
tempfile.rewind]]></content:encoded>
			<link>http://briansblog.net/blog1.php/2008/05/16/file-upload-in-rails#c81</link>
		</item>
				<item>
			<title>In response to: File upload in Rails</title>
			<pubDate>Wed, 21 May 2008 04:46:10 +0000</pubDate>
			<dc:creator>Brian [Member]</dc:creator>
			<guid isPermaLink="false">c52@http://briansblog.net/</guid>
			<description>Send me an email with your error messages and logs, I might be able to help you figure it out:&lt;br /&gt;
&lt;br /&gt;
brian@briansblog.net</description>
			<content:encoded><![CDATA[Send me an email with your error messages and logs, I might be able to help you figure it out:<br />
<br />
brian@briansblog.net]]></content:encoded>
			<link>http://briansblog.net/blog1.php/2008/05/16/file-upload-in-rails#c52</link>
		</item>
				<item>
			<title>In response to: File upload in Rails</title>
			<pubDate>Mon, 19 May 2008 00:58:57 +0000</pubDate>
			<dc:creator>Alien [Visitor]</dc:creator>
			<guid isPermaLink="false">c51@http://briansblog.net/</guid>
			<description>Thanks for the answer, that was just what i made, but when i did the object.save, mysql report an error, and WEBrick crashes, something weird happens...</description>
			<content:encoded><![CDATA[Thanks for the answer, that was just what i made, but when i did the object.save, mysql report an error, and WEBrick crashes, something weird happens...]]></content:encoded>
			<link>http://briansblog.net/blog1.php/2008/05/16/file-upload-in-rails#c51</link>
		</item>
				<item>
			<title>In response to: File upload in Rails</title>
			<pubDate>Sun, 18 May 2008 07:06:54 +0000</pubDate>
			<dc:creator>Brian [Member]</dc:creator>
			<guid isPermaLink="false">c50@http://briansblog.net/</guid>
			<description>While I have never done that, migrations have a field call 'binary' which would probably do the trick&lt;br /&gt;
&lt;br /&gt;
In the migration:&lt;br /&gt;
&lt;br /&gt;
   t.column :myFile, :binary&lt;br /&gt;
&lt;br /&gt;
To save it, you would do something along the lines of:&lt;br /&gt;
&lt;br /&gt;
myObject.myFile = @realFile.read</description>
			<content:encoded><![CDATA[While I have never done that, migrations have a field call 'binary' which would probably do the trick<br />
<br />
In the migration:<br />
<br />
   t.column :myFile, :binary<br />
<br />
To save it, you would do something along the lines of:<br />
<br />
myObject.myFile = @realFile.read]]></content:encoded>
			<link>http://briansblog.net/blog1.php/2008/05/16/file-upload-in-rails#c50</link>
		</item>
				<item>
			<title>In response to: File upload in Rails</title>
			<pubDate>Sun, 18 May 2008 04:06:11 +0000</pubDate>
			<dc:creator>Alien [Visitor]</dc:creator>
			<guid isPermaLink="false">c48@http://briansblog.net/</guid>
			<description>Hi, what about saving files to the database?&lt;br /&gt;
I always get a weird error trying that...</description>
			<content:encoded><![CDATA[Hi, what about saving files to the database?<br />
I always get a weird error trying that...]]></content:encoded>
			<link>http://briansblog.net/blog1.php/2008/05/16/file-upload-in-rails#c48</link>
		</item>
				<item>
			<title>In response to: File upload in Rails</title>
			<pubDate>Sat, 17 May 2008 16:31:51 +0000</pubDate>
			<dc:creator>Brian [Member]</dc:creator>
			<guid isPermaLink="false">c47@http://briansblog.net/</guid>
			<description>If you check a couple posts back, I talked about windows and binary mode. I have patched my Tempfile to do that by default already.&lt;br /&gt;
&lt;br /&gt;
The part here that is confusing me is why I should need to do a rewind on the StringIO before reading it. That and the fact that you have to deal with uploads in 2 ways depending on the file size.</description>
			<content:encoded><![CDATA[If you check a couple posts back, I talked about windows and binary mode. I have patched my Tempfile to do that by default already.<br />
<br />
The part here that is confusing me is why I should need to do a rewind on the StringIO before reading it. That and the fact that you have to deal with uploads in 2 ways depending on the file size.]]></content:encoded>
			<link>http://briansblog.net/blog1.php/2008/05/16/file-upload-in-rails#c47</link>
		</item>
				<item>
			<title>In response to: File upload in Rails</title>
			<pubDate>Sat, 17 May 2008 13:12:39 +0000</pubDate>
			<dc:creator>Luis Lavena [Visitor]</dc:creator>
			<guid isPermaLink="false">c46@http://briansblog.net/</guid>
			<description>The main issue you show here is related to the way files are being handled under Windows.&lt;br /&gt;
&lt;br /&gt;
By default Ruby open files in text mode ('w'), that works under POSIX but under Windows, you need the binary 'b' for the mode or call #binmode as you did.&lt;br /&gt;
&lt;br /&gt;
There are several patches for Tempfile under Windows, some of those came from Rails, try googling for that if you need more info.</description>
			<content:encoded><![CDATA[The main issue you show here is related to the way files are being handled under Windows.<br />
<br />
By default Ruby open files in text mode ('w'), that works under POSIX but under Windows, you need the binary 'b' for the mode or call #binmode as you did.<br />
<br />
There are several patches for Tempfile under Windows, some of those came from Rails, try googling for that if you need more info.]]></content:encoded>
			<link>http://briansblog.net/blog1.php/2008/05/16/file-upload-in-rails#c46</link>
		</item>
			</channel>
</rss>
