You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Geoff Hartman <ge...@fivepack.net> on 2004/08/06 20:33:35 UTC

[users@httpd] PHP & File Uploads!

Hello all:

I am having trouble uploading files with a form. On my server, the
configuration seems to allow is just fine, but on a client server, the file
vars are null. Any clue as to which directives I need to look at here?

PHP seems to be configured fine, it is Apache that may be the issue.

-Geoff



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] PHP & File Uploads!

Posted by Geoff Hartman <ge...@fivepack.net>.
Here are some snippets... again keep in mind, it is woking on one server,
but not another:

FORM HTML:

<form name=form1 action=process_styles.php enctype='multipart/form-data'
method=POST>

<!-- only including the relevant to prevent confusion -->

   <td align="right" valign="top">
   <font color="#000066" size="2" face="Arial, Helvetica, sans-serif">Large
Image</font></td>
   <td><input type="file" name="large_image"></td>
   </tr><tr>
   <td align="right" valign="top">
   <font color="#000066" size="2" face="Arial, Helvetica,
sans-serif">Thumbnail Image</font></td>
   <td><input type="file" name="thumb_image"></td>
   </tr>

<!-- only including the relavant to prevent confusion -->

</form>

ON THE PROCESSING SIDE (It craps out on the first if validation):
<?
set_time_limit(0);
require_once("../configure.php");
require_once( WEB_STORE_ROOT . "global.php");
include(WEB_STORE_ROOT . "OBJECTS/colors_class.php");


$img_arr_1 = getimagesize ($large_image);
$img_arr_2 = getimagesize ($thumb_image);

if ( is_array($img_arr_1)){
 $img_type_1 = $IMG_TYPES[$img_arr_1[2]];
} else {
 //ERROR
 echo "Large Image is not a valid Image type. Image type data:<br>";
 print_r($img_arr_1);
 echo gettype($img_arr_1);
 exit;
}

if ( is_array($img_arr_2)){
 $img_type_2 = $IMG_TYPES[ $img_arr_2[2] ];
} else {
 //ERROR
 echo "Thumb Image is not a valid Image type";
 print_r($img_type_2);
 echo gettype($img_type_2);
 exit;
}



----- Original Message ----- 
From: "Joshua Slive" <js...@gmail.com>
To: <us...@httpd.apache.org>
Sent: Friday, August 06, 2004 12:08 PM
Subject: Re: [users@httpd] PHP & File Uploads!


> On Fri, 6 Aug 2004 11:44:07 -0700, Geoff Hartman <ge...@fivepack.net>
wrote:
> > Register globals is 'off' on the client server, but I have a function
that
> > checks for that and extracts them accordingly. The other form vars are
set
> > properly. As far as what I mean by: "the file vars are null", the file
form
> > field var is '' and seems to not have a temp file name or location.
>
> Apache doesn't mess with form variables, so this is likely to be an
> issue with your code.  But we have no details about anything, so it is
> really impossible to tell.
>
> You may want to start on the php users list.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] PHP & File Uploads!

Posted by Joshua Slive <js...@gmail.com>.
On Fri, 6 Aug 2004 11:44:07 -0700, Geoff Hartman <ge...@fivepack.net> wrote:
> Register globals is 'off' on the client server, but I have a function that
> checks for that and extracts them accordingly. The other form vars are set
> properly. As far as what I mean by: "the file vars are null", the file form
> field var is '' and seems to not have a temp file name or location.

Apache doesn't mess with form variables, so this is likely to be an
issue with your code.  But we have no details about anything, so it is
really impossible to tell.

You may want to start on the php users list.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] PHP & File Uploads!

Posted by Geoff Hartman <ge...@fivepack.net>.
I am now!!

Thanks Tim, I will try that :-)

----- Original Message ----- 
From: "Tim Burden" <ti...@burden.ca>
To: <us...@httpd.apache.org>
Sent: Friday, August 06, 2004 12:19 PM
Subject: Re: [users@httpd] PHP & File Uploads!


> You are aware that files uploaded via forms go in the $_FILES array, and
not
> the $_POST array?
>
> ----- Original Message ----- 
> From: "Geoff Hartman" <ge...@fivepack.net>
> To: <us...@httpd.apache.org>
> Sent: Friday, August 06, 2004 2:44 PM
> Subject: Re: [users@httpd] PHP & File Uploads!
>
>
> > Register globals is 'off' on the client server, but I have a function
that
> > checks for that and extracts them accordingly. The other form vars are
set
> > properly. As far as what I mean by: "the file vars are null", the file
> form
> > field var is '' and seems to not have a temp file name or location.
> >
> > Thanks.
> >
> > ----- Original Message ----- 
> > From: "Joshua Slive" <js...@gmail.com>
> > To: <us...@httpd.apache.org>
> > Sent: Friday, August 06, 2004 11:36 AM
> > Subject: Re: [users@httpd] PHP & File Uploads!
> >
> >
> > > On Fri, 6 Aug 2004 11:33:35 -0700, Geoff Hartman <ge...@fivepack.net>
> > wrote:
> > > > Hello all:
> > > >
> > > > I am having trouble uploading files with a form. On my server, the
> > > > configuration seems to allow is just fine, but on a client server,
the
> > file
> > > > vars are null. Any clue as to which directives I need to look at
here?
> > > >
> > > > PHP seems to be configured fine, it is Apache that may be the issue.
> > >
> > > I love vague problems ;-)
> > >
> > > What does "the file vars are null" mean?
> > >
> > > Do you have "regsiter-globals" set the same on both servers?
> > >
> > > Joshua.
> > >
> > > ---------------------------------------------------------------------
> > > The official User-To-User support forum of the Apache HTTP Server
> Project.
> > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server
Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] PHP & File Uploads!

Posted by Geoff Hartman <ge...@fivepack.net>.
Well, interestingly enough what I ended up having to do was this:

$large_image = $_FILES["large_image"]["tmp_name"];
$thumb_image = $_FILES["thumb_image"]["tmp_name"];

I am thinking it could be the older version of PHP. The newer version must
do some different handling of the posted file array.


----- Original Message ----- 
From: "Tim Burden" <ti...@burden.ca>
To: <us...@httpd.apache.org>
Sent: Friday, August 06, 2004 12:19 PM
Subject: Re: [users@httpd] PHP & File Uploads!


> You are aware that files uploaded via forms go in the $_FILES array, and
not
> the $_POST array?
>
> ----- Original Message ----- 
> From: "Geoff Hartman" <ge...@fivepack.net>
> To: <us...@httpd.apache.org>
> Sent: Friday, August 06, 2004 2:44 PM
> Subject: Re: [users@httpd] PHP & File Uploads!
>
>
> > Register globals is 'off' on the client server, but I have a function
that
> > checks for that and extracts them accordingly. The other form vars are
set
> > properly. As far as what I mean by: "the file vars are null", the file
> form
> > field var is '' and seems to not have a temp file name or location.
> >
> > Thanks.
> >
> > ----- Original Message ----- 
> > From: "Joshua Slive" <js...@gmail.com>
> > To: <us...@httpd.apache.org>
> > Sent: Friday, August 06, 2004 11:36 AM
> > Subject: Re: [users@httpd] PHP & File Uploads!
> >
> >
> > > On Fri, 6 Aug 2004 11:33:35 -0700, Geoff Hartman <ge...@fivepack.net>
> > wrote:
> > > > Hello all:
> > > >
> > > > I am having trouble uploading files with a form. On my server, the
> > > > configuration seems to allow is just fine, but on a client server,
the
> > file
> > > > vars are null. Any clue as to which directives I need to look at
here?
> > > >
> > > > PHP seems to be configured fine, it is Apache that may be the issue.
> > >
> > > I love vague problems ;-)
> > >
> > > What does "the file vars are null" mean?
> > >
> > > Do you have "regsiter-globals" set the same on both servers?
> > >
> > > Joshua.
> > >
> > > ---------------------------------------------------------------------
> > > The official User-To-User support forum of the Apache HTTP Server
> Project.
> > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server
Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] PHP & File Uploads!

Posted by Tim Burden <ti...@burden.ca>.
You are aware that files uploaded via forms go in the $_FILES array, and not
the $_POST array?

----- Original Message ----- 
From: "Geoff Hartman" <ge...@fivepack.net>
To: <us...@httpd.apache.org>
Sent: Friday, August 06, 2004 2:44 PM
Subject: Re: [users@httpd] PHP & File Uploads!


> Register globals is 'off' on the client server, but I have a function that
> checks for that and extracts them accordingly. The other form vars are set
> properly. As far as what I mean by: "the file vars are null", the file
form
> field var is '' and seems to not have a temp file name or location.
>
> Thanks.
>
> ----- Original Message ----- 
> From: "Joshua Slive" <js...@gmail.com>
> To: <us...@httpd.apache.org>
> Sent: Friday, August 06, 2004 11:36 AM
> Subject: Re: [users@httpd] PHP & File Uploads!
>
>
> > On Fri, 6 Aug 2004 11:33:35 -0700, Geoff Hartman <ge...@fivepack.net>
> wrote:
> > > Hello all:
> > >
> > > I am having trouble uploading files with a form. On my server, the
> > > configuration seems to allow is just fine, but on a client server, the
> file
> > > vars are null. Any clue as to which directives I need to look at here?
> > >
> > > PHP seems to be configured fine, it is Apache that may be the issue.
> >
> > I love vague problems ;-)
> >
> > What does "the file vars are null" mean?
> >
> > Do you have "regsiter-globals" set the same on both servers?
> >
> > Joshua.
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server
Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] PHP & File Uploads!

Posted by Geoff Hartman <ge...@fivepack.net>.
Register globals is 'off' on the client server, but I have a function that
checks for that and extracts them accordingly. The other form vars are set
properly. As far as what I mean by: "the file vars are null", the file form
field var is '' and seems to not have a temp file name or location.

Thanks.

----- Original Message ----- 
From: "Joshua Slive" <js...@gmail.com>
To: <us...@httpd.apache.org>
Sent: Friday, August 06, 2004 11:36 AM
Subject: Re: [users@httpd] PHP & File Uploads!


> On Fri, 6 Aug 2004 11:33:35 -0700, Geoff Hartman <ge...@fivepack.net>
wrote:
> > Hello all:
> >
> > I am having trouble uploading files with a form. On my server, the
> > configuration seems to allow is just fine, but on a client server, the
file
> > vars are null. Any clue as to which directives I need to look at here?
> >
> > PHP seems to be configured fine, it is Apache that may be the issue.
>
> I love vague problems ;-)
>
> What does "the file vars are null" mean?
>
> Do you have "regsiter-globals" set the same on both servers?
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] PHP & File Uploads!

Posted by Joshua Slive <js...@gmail.com>.
On Fri, 6 Aug 2004 11:33:35 -0700, Geoff Hartman <ge...@fivepack.net> wrote:
> Hello all:
> 
> I am having trouble uploading files with a form. On my server, the
> configuration seems to allow is just fine, but on a client server, the file
> vars are null. Any clue as to which directives I need to look at here?
> 
> PHP seems to be configured fine, it is Apache that may be the issue.

I love vague problems ;-)

What does "the file vars are null" mean?

Do you have "regsiter-globals" set the same on both servers?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org