Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2003
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problems passing files from a form

    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">
    </form>

    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?


  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    echo "type: ".$HTTP_POST_FILES['pageimage']['type']."<br>\n";

  • #3
    New Coder
    Join Date
    Jan 2003
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks I'll give it a try

    I can confirm it works fine. Thanks
    Last edited by sametch; 02-28-2003 at 05:58 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •