Attachments now opened with binary flag, for windows compatibility
authoritsbruce <itsbruce@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Sep 2002 15:43:11 +0000 (15:43 +0000)
committeritsbruce <itsbruce@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Sep 2002 15:43:11 +0000 (15:43 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3533 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php
src/draft_actions.php
src/move_messages.php
src/read_body.php
src/retrievalerror.php

index 774300f..d130c06 100644 (file)
@@ -645,7 +645,7 @@ function getAttachments($message, $session, $passed_id, $entities, $imapConnecti
             $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));
@@ -684,7 +684,7 @@ function getMessage_RFC822_Attachment($message, $session, $passed_id,
         $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();
index 4bfe365..1bb549a 100644 (file)
@@ -162,7 +162,7 @@ function saveMessageAsDraft($t, $c, $b, $subject, $body, $reply_id, $prio = 3, $
          $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);
@@ -188,4 +188,4 @@ function saveMessageAsDraft($t, $c, $b, $subject, $body, $reply_id, $prio = 3, $
     return $length;
 }
 
-?>
\ No newline at end of file
+?>
index 027fbc0..121a18c 100644 (file)
@@ -96,7 +96,7 @@ function attachSelectedMessages($msg, $imapConnection) {
                $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();
index 1139ea4..cafc9c5 100644 (file)
@@ -206,7 +206,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message) {
     $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);
 
index e95657a..9f9bbac 100644 (file)
@@ -55,7 +55,7 @@ while (file_exists($full_localfilename)) {
 }
 
 /* Write Attachment to file */
-$fp = fopen ($full_localfilename, 'w');
+$fp = fopen ($full_localfilename, 'wb');
 fputs ($fp, $thebastard);
 fclose ($fp);