0

Can anyone help me with the code why it is wrong . What Should i need to do to correct. Thank for your help . Pls help me

if (is_uploaded_file($fileatt3)) {
    $file = fopen($fileatt3,'rb');
    $data = fread($file,filesize($fileatt3));
    fclose($file);
   
    $semi_rand = md5(time());
    $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
   
     $data = chunk_split(base64_encode($data));
   
    $body .= "--{$mime_boundary}\n" .
    "Content-Type: {$fileatt3_type};\n" .
    " name=\"{$fileatt3_name}\"\n" .
    "Content-Transfer-Encoding: base64\n\n" .
    $body . "\n\n" .
    "--{$mime_boundary}--\n";
}

if (is_uploaded_file($fileatt2)) {
    $file = fopen($fileatt2,'rb');
    $data = fread($file,filesize($fileatt2));
    fclose($file);
   
  
    $semi_rand = md5(time());
    $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
   
     $data = chunk_split(base64_encode($data));
   
    $body .= "--{$mime_boundary}\n" .
    "Content-Type: {$fileatt2_type};\n" .
    " name=\"{$fileatt2_name}\"\n" .
    "Content-Transfer-Encoding: base64\n\n" .
    $body . "\n\n" .
    "--{$mime_boundary}--\n";
}
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by andre.vanzuydam
0

You'll need to post your code with code tags so we can see what you are trying to do.

I normally use file_get_contents for reading file data in PHP and PHPMailer for sending emails. Your file input name should contain [] which will create an array of when posting which should be easier to work with.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.