[thelist] Image upload help....

Rob Schumann roblgs at cscoms.com
Wed Jun 26 04:23:01 CDT 2002


I have a problem... The code was working prior to a switch to php 4.2.1 and now is not.

I'm uploading image files where the "name" property of the <input type="FILE"... is the value of a variable.

<FORM ENCTYPE="multipart/form-data"
      method="POST" action="<?php echo $upl_File?>">
<input type="FILE" name="<?php echo $upl_File?>">

This was previously handled with a global declaration to catch all four of the generated variables

global $$upl_File, ${$upl_File . "_name"};
global ${$upl_File . "_size"}, ${$upl_File . "_type"};

This was fine under 4.1.2, but now under 4.2.1 it no longer works... the resulting html code in the form is (for the relevant line in the table)

<input type="FILE" name="img_File">

where "img_File" was the value of the $upl_File variable in the php. No surprises so far...

If I run a check on $_POST super global on the far side of the call the img_File key DOESN'T EVEN EXIST!!! This I do find bizarre and it has me stumped.... Any ideas on how to return to working code would be gratefully received. This seems to be the last remaining problem in migrating a site to the new php and I'd love to get it fixed quickly.

Many thanks in advance...


More information about the thelist mailing list