On Tue, Sep 14, 2010 at 9:50 AM, Amit Tomar <li...@ruby-forum.com> wrote:
>
> this is how am uploading
> def upload(params)
>
>        path = get_path(params)
>        File.open(path, "wb") do |f|
>        while buff= params[:location].read(4096)
>
>        f.write(buff)
>        end
>        end
> end
>

That is copying the file every 4k for you, you can simply File.move
form the temporay filename to the final name in your remote location.

It is expected you dispose the temporary file when you're done with it.

Please see how proper file uploading and processing is done with Ruby on Rails.
-- 
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
_______________________________________________
Mongrel-users mailing list
Mongrel-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to