title: php Form file upload noname file
body: <p>Hi I have this piece of code: </p>
  
  <pre><code>    &lt;?php
  $name = $_POST['name']; 
  $email = $_POST['email'];
  $phone = $_POST['phone'];
  $company = $_POST['company'];
  $phone = $_POST['phone'];
  $address = $_POST['address'];
  $address2 = $_POST['address1'];
  $zip = $_POST['zip'];
  $delivery = $_POST['delivery'];
  $represents = $_POST['represent'];
  $npairs = $_POST['npairs'];
  $cuff = $_POST['cuff'];
  $notes = $_POST['Text'];
  
      // Headers
          $headers = "From: $email";
  
          // create a boundary string. It must be unique
            $semi_rand = md5(time());
            $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
  
            // Add the headers for a file attachment
            $headers .= "\nMIME-Version: 1.0\n" .
                        "Content-Type: multipart/mixed;\n" .
                        " boundary=\"{$mime_boundary}\"";
  
  
          $fileatt      = $_FILES['artwork1']['tmp_name'];
          $fileatt_type = $_FILES['artwork1']['type'];
          $fileatt_name = $_FILES['artwork1']['name'];
  
  
  $todayis = date("l, F j, Y, g:i a") ;
  
  $attn = $attn ; 
  $subject = $attn; 
  
  $notes = stripcslashes($notes);
  $interested = stripcslashes($interested);
  
  $message = " $todayis [EST] \n
  From: $name \n
  e-mail: $email \n
  Phone: $phone \n
  Company: $company \n
  Phone: $phone\n
  Address: $Address\n
  State / Providence:  $address2\n 
  Zip code: $zip
  Country: $delivery
  
  Represents: $represents
  Number of pairs: $npairs
  Style of Socks: $cuff
  
  
  
  Message: $notes \n 
  ";
  
          if (is_uploaded_file($fileatt)) {
            // Read the file to be attached ('rb' = read binary)
            $file = fopen($fileatt,'rb');
            $data = fread($file,filesize($fileatt));
            fclose($file);
  
            // Base64 encode the file data
            $data = chunk_split(base64_encode($data));
  
            // Add file attachment to the message
            $message .= "--{$mime_boundary}\n" .
                        "Content-Type: {$fileatt_type};\n" .
                        " name=\"{$fileatt_name}\"\n" .
                        //"Content-Disposition: attachment;\n" .
                        //" filename=\"{$fileatt_name}\"\n" .
                        "Content-Transfer-Encoding: base64\n\n" .
                        $data . "\n\n" .
                        "--{$mime_boundary}--\n";
          }
  
  
  
  
  
   );
  
  mail("my@mail.com", 'My tittle', $message,$headers);
  
  ?&gt;
  </code></pre>
  
  <p>But for some reason the attached file when I recieve it on my mail has no information on it i recive "noname." no extension or anything.. would somebody know where Im doing wrong?</p>