$newAttachment['session'] = $session;
/* Write Attachment to file */
- $fp = fopen ("$hashed_attachment_dir/$localfilename", 'w');
+ $fp = fopen ("$hashed_attachment_dir/$localfilename", 'wb');
fputs($fp, decodeBody(mime_fetch_body($imapConnection,
$passed_id, $message->entity_id),
$message->header->encoding));
$localfilename = GenerateRandomString(32, 'FILE', 7);
$full_localfilename = "$hashed_attachment_dir/$localfilename";
- $fp = fopen( $full_localfilename, 'w');
+ $fp = fopen( $full_localfilename, 'wb');
fwrite ($fp, $body);
fclose($fp);
$newAttachment = array();
$tmpDraftFile = "draft-" . GenerateRandomString(32, '', 7);
$full_tmpDraftFile = "$hashed_attachment_dir/$tmpDraftFile";
}
- $fp = fopen($full_tmpDraftFile, 'w');
+ $fp = fopen($full_tmpDraftFile, 'wb');
$headerlength = write822HeaderForDraft
($fp, $t, $c, $b, $subject, $more_headers, $session);
return $length;
}
-?>
\ No newline at end of file
+?>
$localfilename = GenerateRandomString(32, 'FILE', 7);
$full_localfilename = "$hashed_attachment_dir/$localfilename";
- $fp = fopen( $full_localfilename, 'w');
+ $fp = fopen( $full_localfilename, 'wb');
fwrite ($fp, $body);
fclose($fp);
$newAttachment = array();
$localfilename = GenerateRandomString(32, 'FILE', 7);
$full_localfilename = "$hashed_attachment_dir/$localfilename";
- $fp = fopen( $full_localfilename, 'w');
+ $fp = fopen( $full_localfilename, 'wb');
fwrite ($fp, $part2);
fclose($fp);
}
/* Write Attachment to file */
-$fp = fopen ($full_localfilename, 'w');
+$fp = fopen ($full_localfilename, 'wb');
fputs ($fp, $thebastard);
fclose ($fp);