From: Sacha Schlegel Date: 2003-06-23T20:43:54+09:00 Subject: Re: File upload and mod-ruby This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_wasp.net.au-23522-1056368622-0001-2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2003-06-23 at 19:36, George Moschovitis wrote: > Hello everybody, >=20 > I am wondering if anyone can help me with implementing a file-upload > script using Apache2.0 and modruby1.1.1 >=20 > lets say I have a form like this >=20 >
>
> >
>=20 > what code should i use in upload.rb to grabe the filedata + filename > from the apache/modruby request. I want to save the file in a custom > directory. >=20 This is for apache 1.3.x not sure about 2 though: ---------------------------------------- require 'cgi' cgi =3D CGI.new() # New CGI object myfile =3D cgi.params['myfile'].first.path ---------------------------------------- myfile is the file name which you can sue for File.new(myfile) you might have to look at the http.conf=20 ... RubySafeLevel 0 ... in particular RubySafeLevel if you run into permission errors/exceptions. Sacha > Any help appreciated, > -g. >=20 > --=20 ------------------------------------------------ Sacha Schlegel ------------------------------------------------ 4 Warwick Str, 6102 St. James, Perth, Australia sacha@schlegel.li www.schlegel.li public key: www.schlegel.li/sacha.gpg ------------------------------------------------ --=_wasp.net.au-23522-1056368622-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA+9ufhjTNlL0xFfy4RAvERAJ91O/8trWRpqevOzIJtstIy8DpN4QCfTht7 qKMYWS2hdpSu2abfL9JjCfI= =V07t -----END PGP SIGNATURE----- --=_wasp.net.au-23522-1056368622-0001-2--