From purpleshirt@hotmail.com Mon May 28 12:51:02 2001 From: Purple Shirt To: users@lists.opensuse.org Subject: Re: [SLE] php/apache file upload Date: Mon, 28 May 2001 12:51:02 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5208513869516371334==" --===============5208513869516371334== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ^M makes me suspicious of dos formatted content. shouldn't matter but u may want to try a file other than the one u using with unix line breaks. >From: "Robert C. Paulsen Jr." >To: Purple Shirt >CC: suse-linux-e@suse.com >Subject: Re: [SLE] php/apache file upload >Date: Mon, 28 May 2001 07:11:04 -0500 > >Thanks fror the reply. I tried moving the script to /usr/local/httpd/htdocs >but I get the same error I gor before: > >========================================================================= >
>Warning: Unable to open 'Content-Type: text/plain;^M > name=\"sample.txt\"^M >^M >here is the text of my sample file. >' for reading: No such file or directory in >/usr/local/httpd/htdocs/upload.php on line 3
>

Upload error

>========================================================================= > >(This time I have shown the same error messaeg, but as it appears if >I do a "view source" in the browser and cut-and-paste from there.) > >Still a mystery to me why the $userfie variable contains all that. Perhaps >the ^M characters are a clue as to where it is coming from. > >I also tried turning safe mode off (in php.ini) but it made no difference. > > > >On Mon, May 28, 2001 at 04:23:32AM +0000, Purple Shirt wrote: > > I tried it. I put it into /usr/local/httpd/htdocs and it works there as >it > > has root permissions. I couldn't get it to go in user file space. > > > > Warning: SAFE MODE Restriction in effect. The script whose uid is 500 is >not > > allowed to access /tmp/phpdOzA3b owned by uid 0 in > > /home/user/public_html/upload.php on line 7 > > > > Upload error > > > > mk > > > > >From: "Robert C. Paulsen Jr." > > >To: suse-linux-e@suse.com > > >Subject: [SLE] php/apache file upload > > >Date: Sun, 27 May 2001 21:28:06 -0500 > > > > > >(I will be sending this same message to the php mailing list if my > > >subscription request comes through. Until then, perhaps someone here > > >can help.) > > > > > >I am having trouble with file upload. > > > > > > OS: Linux (SuSE 7.0) > > > HTTP: Apache 1.3.19 > > > PHP: 4.0.4pl1 > > > > > >I am using the technique I have seen in about there different books and >on > > >the php web page. The problem seems to be that the variable I thought >was > > >supposed to contain the name of the temp file where the file was >uploaded > > >contains quite a bit more. Here is the entire script and the output >from > > >running it: > > > > > > >========================================================================= > > > > > > > >print ""; > > > > > >if ( $submit=='upload') { > > > $upfile='/home/robert/open/uploaded.txt'; > > > if (copy($userfile,$upfile)) > > > print '

Uploaded OK

'; > > > else > > > print '

Upload error

'; > > > > > >} else { > > > print " > > >
> > > > > > Upload file: > > > > > > "; > > >} > > > > > >print ""; > > > >========================================================================= > > > > > >When I use this script to attempt an upload here is what I see: > > > > > >Warning: Unable to open 'Content-Type: text/plain; name=\"sample.txt\" > > >here is the content of my sample file. ' for reading: No such file or > > >directory in /home/robert/public_html/upload.php on line 7 > > > > > >Line 7 is the copy function. > > > > > >It appears that the variable $userfile contains not only the name of my > > >file > > >but its contents as well. I verified this by adding the line: > > > > > > print "$userfile" > > > > > >And it prints: > > > > > >Content-Type: text/plain; name=\"sample.txt\" here is the content of my > > >sample file. > > > > > >What am I missing? > > > > > >"sample.txt" contains: > > > >========================================================================= > > >here is the content of my sample file. > > > >========================================================================= > > > > >-- >____________________________________________________________________ >Robert Paulsen paulsen@texas.net > >-- >To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com >For additional commands send e-mail to suse-linux-e-help@suse.com >Also check the FAQ at http://www.suse.com/support/faq and the >archives at http://lists.suse.com > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com --===============5208513869516371334==-- From paulsen@texas.net Mon May 28 12:57:28 2001 From: "Robert C. Paulsen Jr." To: users@lists.opensuse.org Subject: Re: [SLE] php/apache file upload Date: Mon, 28 May 2001 07:57:26 -0500 Message-ID: <20010528075726.A3697@avalon.paulsen.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8376732484102019137==" --===============8376732484102019137== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Well, I have tried many files. The one I gave here was just to demonstrrate the problem I am having in a much larger context. The real question is not "why are there DOS line breaks?" but "why does the variable contain anything at all, beyond a simple file name?" On Mon, May 28, 2001 at 12:51:02PM +0000, Purple Shirt wrote: > ^M makes me suspicious of dos formatted content. shouldn't matter but u may= =20 > want to try a file other than the one u using with unix line breaks. >=20 >=20 > >From: "Robert C. Paulsen Jr." > >To: Purple Shirt > >CC: suse-linux-e@suse.com > >Subject: Re: [SLE] php/apache file upload > >Date: Mon, 28 May 2001 07:11:04 -0500 > > > >Thanks fror the reply. I tried moving the script to /usr/local/httpd/htdocs > >but I get the same error I gor before: > > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >
> >Warning: Unable to open 'Content-Type: text/plain;^M > > name=3D\"sample.txt\"^M > >^M > >here is the text of my sample file. > >' for reading: No such file or directory in=20 > >/usr/local/httpd/htdocs/upload.php on line 3
> >

Upload error

> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > >(This time I have shown the same error messaeg, but as it appears if > >I do a "view source" in the browser and cut-and-paste from there.) > > > >Still a mystery to me why the $userfie variable contains all that. Perhaps > >the ^M characters are a clue as to where it is coming from. > > > >I also tried turning safe mode off (in php.ini) but it made no difference. > > > > > > > >On Mon, May 28, 2001 at 04:23:32AM +0000, Purple Shirt wrote: > > > I tried it. I put it into /usr/local/httpd/htdocs and it works there as= =20 > >it > > > has root permissions. I couldn't get it to go in user file space. > > > > > > Warning: SAFE MODE Restriction in effect. The script whose uid is 500 i= s=20 > >not > > > allowed to access /tmp/phpdOzA3b owned by uid 0 in > > > /home/user/public_html/upload.php on line 7 > > > > > > Upload error > > > > > > mk > > > > > > >From: "Robert C. Paulsen Jr." > > > >To: suse-linux-e@suse.com > > > >Subject: [SLE] php/apache file upload > > > >Date: Sun, 27 May 2001 21:28:06 -0500 > > > > > > > >(I will be sending this same message to the php mailing list if my > > > >subscription request comes through. Until then, perhaps someone here > > > >can help.) > > > > > > > >I am having trouble with file upload. > > > > > > > > OS: Linux (SuSE 7.0) > > > > HTTP: Apache 1.3.19 > > > > PHP: 4.0.4pl1 > > > > > > > >I am using the technique I have seen in about there different books an= d=20 > >on > > > >the php web page. The problem seems to be that the variable I thought= =20 > >was > > > >supposed to contain the name of the temp file where the file was=20 > >uploaded > > > >contains quite a bit more. Here is the entire script and the output=20 > >from > > > >running it: > > > > > > >=20 > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > > > > > > > >print ""; > > > > > > > >if ( $submit=3D=3D'upload') { > > > > $upfile=3D'/home/robert/open/uploaded.txt'; > > > > if (copy($userfile,$upfile)) > > > > print '

Uploaded OK

'; > > > > else > > > > print '

Upload error

'; > > > > > > > >} else { > > > > print " > > > > > > > > > > > > Upload file: > > > > > > > > "; > > > >} > > > > > > > >print ""; > > >=20 > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > > > > >When I use this script to attempt an upload here is what I see: > > > > > > > >Warning: Unable to open 'Content-Type: text/plain; name=3D\"sample.tx= t\" > > > >here is the content of my sample file. ' for reading: No such file or > > > >directory in /home/robert/public_html/upload.php on line 7 > > > > > > > >Line 7 is the copy function. > > > > > > > >It appears that the variable $userfile contains not only the name of my > > > >file > > > >but its contents as well. I verified this by adding the line: > > > > > > > > print "$userfile" > > > > > > > >And it prints: > > > > > > > >Content-Type: text/plain; name=3D\"sample.txt\" here is the content of= my > > > >sample file. > > > > > > > >What am I missing? > > > > > > > >"sample.txt" contains: > > >=20 > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > >here is the content of my sample file. > > >=20 > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > > > > >-- > >____________________________________________________________________ > >Robert Paulsen paulsen@texas.net > > > >-- > >To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com > >For additional commands send e-mail to suse-linux-e-help@suse.com > >Also check the FAQ at http://www.suse.com/support/faq and the > >archives at http://lists.suse.com > > >=20 > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com >=20 >=20 > --=20 > To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com > For additional commands send e-mail to suse-linux-e-help@suse.com = =20 > Also check the FAQ at http://www.suse.com/support/faq and the > archives at http://lists.suse.com =20 >=20 --=20 ____________________________________________________________________ Robert Paulsen paulsen@texas.net --===============8376732484102019137==--