Help with PHP File Upload Issue

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

    Help with PHP File Upload Issue

    I am attempting to upload files via. PHP 4.4.4. The
    '$_FILES['update']['tmp_name'][0]' resolves to '/tmp/phpey9MpD', but
    when I go to the /tmp dir. I do not see any php* file.

    Could this be a issue with PHP or unix permissions for the web server?

    Do I need to set an absolure dir. in the INI to make this work?

    Confused as this works fine under another system with PHP 5.x.

    ============== (the html upload form) ===============
    <form
    name="upload" action="admin_t est.php" method="post"
    enctype="multip art/form-data">
    <input
    type="hidden" name="what" value="process" >
    <table
    cellpadding="2" cellspacing="0" border="0" width="90%" align="center">
    <tr>

    <td class="reg">1. </td>

    <td class="reg"><in put type="File" name="update[]" size="15"></td>
    </tr>
    <tr>

    <td class="reg">2. </td>

    <td class="reg"><in put type="File" name="update[]" size="15"></td>
    </tr>
    <tr>

    <td align="right">& nbsp;</td>

    <td><input class="button" type="submit" name="loginbtn"
    value="Upload"> </td>
    </tr>
    </table>
    </form>

  • lorento

    #2
    Re: Help with PHP File Upload Issue

    /tmp/phpey9MpD is the temporary file name for your uploaded file. You
    must copy or move the temporary file to other directory immediatelly.
    You can't find that file in /tmp because after the script run, php will
    delete the temporary file.

    use move_uploaded_f ile() function to handle the upload file.

    ---



    David wrote:
    I am attempting to upload files via. PHP 4.4.4. The
    '$_FILES['update']['tmp_name'][0]' resolves to '/tmp/phpey9MpD', but
    when I go to the /tmp dir. I do not see any php* file.
    >
    Could this be a issue with PHP or unix permissions for the web server?
    >
    Do I need to set an absolure dir. in the INI to make this work?
    >
    Confused as this works fine under another system with PHP 5.x.
    >
    ============== (the html upload form) ===============
    <form
    name="upload" action="admin_t est.php" method="post"
    enctype="multip art/form-data">
    <input
    type="hidden" name="what" value="process" >
    <table
    cellpadding="2" cellspacing="0" border="0" width="90%" align="center">
    <tr>
    >
    <td class="reg">1. </td>
    >
    <td class="reg"><in put type="File" name="update[]" size="15"></td>
    </tr>
    <tr>
    >
    <td class="reg">2. </td>
    >
    <td class="reg"><in put type="File" name="update[]" size="15"></td>
    </tr>
    <tr>
    >
    <td align="right">& nbsp;</td>
    >
    <td><input class="button" type="submit" name="loginbtn"
    value="Upload"> </td>
    </tr>
    </table>
    </form>

    Comment

    • peter

      #3
      Re: Help with PHP File Upload Issue

      >I am attempting to upload files via. PHP 4.4.4. The
      '$_FILES['update']['tmp_name'][0]' resolves to '/tmp/phpey9MpD', but
      when I go to the /tmp dir. I do not see any php* file.
      temp files are deleted when the script finishes executing so unless you run
      the script through a loop to give you a chance to see it unlikely you will
      ever see the file.


      Comment

      Working...