hi all! i can''t speak english well.. i want know that file upload... Search has a lot of time. i can find just one Example this link.. http://www.oreillynet.com/ruby/blog/2007/01/the_joy_of_rolling_your_own_wi_1.html And it was typed. but, error occurs. error code(Fold) is... Camping Problem!Conf::Controllers::Upload.POSTNoMethodError undefined method> `Tempfile'' for "glasses.pdf":String: > > - conf_mongrel.rb:224:in `post'' > - (eval):27:in `send'' > - (eval):27:in `service'' > - (eval):46:in `run'' > - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:53:in `process'' > - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `synchronize'' > - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `process'' > - /usr/local/lib/site_ruby/1.8/mongrel.rb:159:in `process_client'' > >why can''t find method? my code has this line require ''tempfile'' i can''t understand.... and second question is .... What is the way typical file upload in camping? i want example code.... Curious does not sleep. plz teach me. thank you for reading my article.. have a nice day... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20090402/60c5dfbf/attachment.html>
In the current version of Camping, we use Rack. Rack has a slightly different upload system. To read the contents of an uploaded file, where the upload was done using <input type="file" name="upload"> you must now do: input.upload[:tempfile].read This also applies to file uploads done using Adobe Flash. :) ? Jenna On 02/04/2009, at 4:22 AM, in-seok hwang wrote:> hi all! > > i can''t speak english well.. > > i want know that file upload... > > Search has a lot of time. > > i can find just one Example > > this link.. > > http://www.oreillynet.com/ruby/blog/2007/01/the_joy_of_rolling_your_own_wi_1.html > > And it was typed. > > but, error occurs. > > error code(Fold) is... > > Camping Problem! > > Conf::Controllers::Upload.POST > > NoMethodError undefined method `Tempfile'' for "glasses.pdf":String: > > conf_mongrel.rb:224:in `post'' > (eval):27:in `send'' > (eval):27:in `service'' > (eval):46:in `run'' > /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:53:in `process'' > /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `synchronize'' > /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `process'' > /usr/local/lib/site_ruby/1.8/mongrel.rb:159:in `process_client'' > > why can''t find method? > > my code has this line > require ''tempfile'' > > i can''t understand.... > > and second question is .... > > What is the way typical file upload in camping? > > i want example code.... > > Curious does not sleep. > > plz teach me. > > thank you for reading my article.. > > have a nice day... > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20090402/9c8066be/attachment-0001.html>
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 2009/4/2 Jenna Fox <blueberry at creativepony.com>> In the current version of Camping, we use Rack. Rack has a slightly > different upload system. > To read the contents of an uploaded file, where the upload was done using > <input type="file" name="upload"> you must now do: > > input.upload[:tempfile].read > > This also applies to file uploads done using Adobe Flash. :) > > ? > Jenna > > On 02/04/2009, at 4:22 AM, in-seok hwang wrote: > > hi all! > > i can''t speak english well.. > > i want know that file upload... > > Search has a lot of time. > > i can find just one Example > > this link.. > > > http://www.oreillynet.com/ruby/blog/2007/01/the_joy_of_rolling_your_own_wi_1.html > > And it was typed. > > but, error occurs. > > error code(Fold) is... > > Camping Problem!Conf::Controllers::Upload.POST NoMethodError undefined >> method `Tempfile'' for "glasses.pdf":String: >> >> - conf_mongrel.rb:224:in `post'' >> - (eval):27:in `send'' >> - (eval):27:in `service'' >> - (eval):46:in `run'' >> - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:53:in `process'' >> - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `synchronize'' >> - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `process'' >> - /usr/local/lib/site_ruby/1.8/mongrel.rb:159:in `process_client'' >> >> > why can''t find method? > > my code has this line > require ''tempfile'' > > i can''t understand.... > > and second question is .... > > What is the way typical file upload in camping? > > i want example code.... > > Curious does not sleep. > > plz teach me. > > thank you for reading my article.. > > have a nice day... > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20090402/0d1854d7/attachment.html>
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 <his2000x at 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 > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20090420/03518e2e/attachment.html>