Something like this should work for the old version of Camping:

  class Upload < R '/upload'
    def get
      render :upload
    end
    def post
      upload   = @input.upload
      filename = File.basename(upload.filename)
      puts @input.upload[:tempfile].path
      puts filename
      File.link(upload[:tempfile].path, filename)
      redirect R(Home)
    end
  end

# the :upload view

  def upload
    form.upload(:method => 'post', :enctype => 'multipart/form-data',
:action => R(Upload)) {
      input             :type => 'file',   :name => 'upload'
      input.post.button :type => 'submit', :name => 'submit', :value =>
'POST'
    }
  end



2009/4/1 in-seok hwang <his20...@gmail.com>

> oh... sorry.
>
> i can't use current version.
> I had a lot of code writing.
>
> i used 1.5.180 camping version.
>
> when i upgrade to the latest version is a lot of errors.
>
> but, I want to use the latest version.
>
> Anyway,
>
> how do upload file in 1.5.180
>
>
_______________________________________________
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to