File Upload Problem - nothing in /tmp

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leigh Riley

    File Upload Problem - nothing in /tmp

    My PHP.ini file sets the following:

    file_uploads = on
    upload_max_file size = 3M
    upload_tmp_dir = /tmp

    When I try and upload the file, it doesn't appears in /tmp.

    The name of the Submit button is userFile. On the processing page, I
    echo $userFile and it gives "/tmp/phpjXJ1ZK". However, the following
    code does nothing:

    copy($userfile,
    "/www/servers/guinfit/uploads/".$HTTP_POST_FI LES['userfile']['name']);

    Can anyone think of anything that might be wrong? It works under one
    Linux installation, but not in the other. The php.ini upload settings
    are exactly the same, and chmodding the /tmp/ to 777(!) doesn't work, so
    I don't think it's a permissions problem.

    Thanks in advance for any replies!!!

  • Justin Koivisto

    #2
    Re: File Upload Problem - nothing in /tmp

    Leigh Riley wrote:[color=blue]
    > My PHP.ini file sets the following:
    >
    > file_uploads = on
    > upload_max_file size = 3M
    > upload_tmp_dir = /tmp
    >
    > When I try and upload the file, it doesn't appears in /tmp.
    >
    > The name of the Submit button is userFile. On the processing page, I
    > echo $userFile and it gives "/tmp/phpjXJ1ZK". However, the following
    > code does nothing:
    >
    > copy($userfile,
    > "/www/servers/guinfit/uploads/".$HTTP_POST_FI LES['userfile']['name']);
    >
    > Can anyone think of anything that might be wrong? It works under one
    > Linux installation, but not in the other. The php.ini upload settings
    > are exactly the same, and chmodding the /tmp/ to 777(!) doesn't work, so
    > I don't think it's a permissions problem.
    >
    > Thanks in advance for any replies!!!
    >[/color]

    Makde sure you have:

    <form ENCTYPE="multip art/form-data">

    Then access the temp file name with:

    $_FILES['userFlie']['tmp_name']


    --
    Justin Koivisto - spam@koivi.com
    PHP POSTERS: Please use comp.lang.php for PHP related questions,
    alt.php* groups are not recommended.

    Comment

    Working...