View Full Version : Problems passing files from a form

02-26-2003, 03:50 PM
I am trying to pass a file from a form to another php page that will upload it.

Each time the variable passed end up being null.

The settings in my form are:

<form name="form1" method="post" action="upload.php" enctype="multipart/form-data">
<input type="file" name="pageimage">
<input type="submit" name="Submit" value="Submit">

The form works fine, I can browse to a file on my local machine and its filename/path are added in the text box.

But when I check the value of the variable $pageimage on the "upload.php" page it is NULL.

I am checking it thus:

$pageimage = $HTTP_POST_VARS['pageimage'];
echo "Image type is = ".gettype($pageimage);

Does anyone know why it may not be passing the value across?


02-26-2003, 04:28 PM
echo "type: ".$HTTP_POST_FILES['pageimage']['type']."<br>\n";

02-26-2003, 05:43 PM
thanks I'll give it a try :thumbsup:

I can confirm it works fine. Thanks:)