[imp] error sending attached file

Thiago Faria de Andrade thiago@rezendesistemas.com.br
Mon, 27 May 2002 10:40:24 -0300

Hi all,

When I send a file with more than 2 MB (I noted this... not a exact 
value) I get a error "There was an error sending your message"... 
then I try to send again, I don't attach the file again... and I get 
errors on the lines marked with ***

        for ($i = 0; $i < count($HTTP_POST_VARS['attachments_name']); 
$i++) {
            /* Read it from the filesystem if it's a normal
               attachment, and then delete the temp file. */
            if (!preg_match('|.*-(.*).mime$|', $HTTP_POST_VARS
['attachments_file'][$i], $regs)) {
                $filename = tempFilePath($HTTP_POST_VARS
      ***          $fd = fopen($filename, 'rb');
      ***          $contents = fread($fd, filesize($filename));
      ***          fclose($fd);
      ***          unlink($filename);
            } else {
                /* Fetch it from the mail message content if it's a
                 * forwarded attachment. */
                $ref = $regs[1];
                $fmime = $attachments[$ref];
                $contents = IMP::getDecodedPart($fmime);

I think the temporary file is being removed after the first error... 
but I have no ideia why the first error message.


Thiago Faria
Plight Sistemas - Desenvolvendo Soluções - http://www.plight.com.br