Hongli,

I think it would be easier if everything was Tempfile.
Even as the optimization made to the upload is for files smaller than
10K, any file larger than it is returned as a Tempfile.
I think that people on the list do not agree with that, then I think it
is better not put the patch on trac, even though it is very simple.
Documenting this behavior is a good start as the KOZ said. I try to find
the best place to do this. Any suggestions?


Cheers,

Jo�o

On Thu, 2007-11-15 at 03:45 -0800, Hongli Lai wrote:
> There are more issues though. I've documented them here:
> http://izumi.plan99.net/blog/index.php/2007/04/07/ruby-on-railss-handling-of-uploaded-files/
> To summarize:
> 1. Some libraries, such as RMagick, also have bugs. RMagick.read (or
> something) checks whether its parameter is an IO object, and if not,
> it will treat the parameter as a filename. StringIO.is_a?(IO) returns
> false, so if I pass a StringIO to RMagick it will think that it's a
> filename.
> 2. If the uploaded file is a Tempfile, then you have to unlink it
> manually, or it will stay on the filesystem. StringIO doesn't have an
> unlink method so you have to manually check whether you can call
> unlink or whether the object is a Tempfile.
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to