Re: file uploading

Daniel Bretoi <[email protected]>
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
You're right, it's not what I wanted to hear. But with the PHP in mind,
have you been able to enbed both PHP tags and embedded ruby in the same
file? 

I tried awhile back, but had no success. Apache wouldn't let me or
something. Conceptually, I don't see a problem since they use different
tags.

db

On Fri, Jan 23, 2004 at 09:59:00AM -0800, paul vudmaska wrote:
> I found that the best way to upload files with ruby is
> to use php <G>. Know that does not help but wanted to
> let you know others have tried(me) and failed but am
> anxiously awaiting your success. Ill look into it
> again and post if i have some success.
> 
> Paul
> --- Daniel Bretoi <[email protected]> wrote:
> > Hi,
> > 
> > I must have being doing something wrong in context,
> > because I just tried
> > the little snippet I pasted, and it seems to be
> > doing more things right.
> > 
> > However, with this code, I get:
> > 
> > [Fri Jan 23 09:23:19 2004] [error] mod_ruby: error
> > in ruby
> > /usr/lib/ruby/1.8/cgi.rb:1039:in `read_multipart':
> > undefined method
> > `dump' for nil:NilClass (NoMethodError)
> >         from /usr/lib/ruby/1.8/cgi.rb:987:in `loop'
> >         from /usr/lib/ruby/1.8/cgi.rb:1076:in
> > `read_multipart'
> >         from /usr/lib/ruby/1.8/cgi.rb:1116:in
> > `initialize_query'
> >         from /usr/lib/ruby/1.8/cgi.rb:2299:in
> > `initialize'
> >         from /tmp/blah.rhtml.28802.0:1:in `new'
> >         from /tmp/blah.rhtml.28802.0:1
> >         from
> > /usr/lib/ruby/1.8/apache/eruby-run.rb:113:in `load'
> >         from
> > /usr/lib/ruby/1.8/apache/eruby-run.rb:113:in `run'
> >         from
> > /usr/lib/ruby/1.8/apache/eruby-run.rb:78:in
> > `handler'
> > 
> > 
> > full code:
> > 
> > <% require 'cgi'; @cgi = CGI.new  %>
> > 
> > <% p @cgi.params['drop'].first %>
> > <form method='post' enctype='multipart/form-data'>
> > Drop Location: <input type=file name=drop>
> > <input type=submit name=submit> 
> > </form>
> > 
> > 
> > On Fri, Jan 23, 2004 at 12:13:46PM -0500, Daniel
> > Bretoi wrote:
> > > Hi,
> > > 
> > > I've been searching through the archives, but I
> > can't seem to get file
> > > uploading to work. Here is what I have.
> > > 
> > > <% p @cgi.params['drop'].first %>
> > > <form method='post' enctype='multipart/form-data'>
> > > Drop Location: <input type=file name=drop>
> > > <input type=submit name=submit>
> > > </form>
> > > 
> > > The code just returns the name of the file which
> > is input into drop, not
> > > the file data.
> > > 
> > > May I also suggest that the answer get's put on
> > the modruby.org FAQ
> > > section as I'm sure it's a common request.
> > > 
> > > Thanks,
> > > 
> > > Daniel
> > > 
> > > (@cgi is defined as: @cgi = CGI.new)
> > > 
> > > 
> > > -- 
> > > "The two aims of the Party are to conquer the
> > whole surface of the earth
> > > and to extinguish once and for all the possiblity
> > of independant thought."
> > > -- 1984, George Orwell
> > 
> > -- 
> > "The two aims of the Party are to conquer the whole
> > surface of the earth
> > and to extinguish once and for all the possiblity of
> > independant thought."
> > -- 1984, George Orwell
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!
> http://webhosting.yahoo.com/ps/sb/

-- 
"The two aims of the Party are to conquer the whole surface of the earth
and to extinguish once and for all the possiblity of independant thought."
-- 1984, George Orwell
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.