Results 1 to 2 of 2

Thread: Help: retrieve form values - multipart/form-data

  1. #1
    Join Date
    May 2005

    Angry Help: retrieve form values - multipart/form-data

    Hi I have a form that uploads a file the form is like this.

    <form enctype="multipart/form-data" method = "post" action="myFile.php">
    <input type="file" name="file1">

    Now I tried to get the field 'file1' in 'myFile.php' like this

    $theFileName = $_POST['file1'];

    This returns nothing.

    But if i remove the part enctype="multipart/form-data" in the form tag
    I get the value. How do I get the value without removing enctype="multipart/form-data"???

  2. #2
    Join Date
    Jan 2005
    Alicante (Spain)
    $theFileName = $_FILES['file1']['name'];

    That just gives the file name though. After the upload the file is stored in the temp directory as $_FILES['file1']['tmpname'] and will be deleted at the end of the script unless you do something with it like email it or file it.
    Last edited by bokeh; 08-12-2005 at 10:39 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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