html文本框:发送html、附件、文本文件、html图片的类(2)来源: 发布时间:星期四, 2009年2月12日 浏览:163次 评论:0
*******************************************************************************/ function formatAttachmentHeader($inFileLocation){ $outAttachmentHeader = \"\"; //--get content type based _disibledevent=>= $this->getContentType($inFileLocation); //-- content type is TEXT the standard 7bit encoding (ereg( \"text\",$contentType)){ //--format header $outAttachmentHeader .= \"Content-Type: \".$contentType. \";n\"; $outAttachmentHeader .= \' name=\"\'.basename($inFileLocation). \'\"\'. \"n\"; $outAttachmentHeader .= \"Content-Transfer-Encoding: 7bitn\"; $outAttachmentHeader .= \"Content-Disposition: attachment;n\"; //--other: inline $outAttachmentHeader .= \' filename=\"\'.basename($inFileLocation). \'\"\'. \"nn\"; $textFile = fopen($inFileLocation, \"r\"); //--loop through file, line by line while(!feof($textFile)){ //--get 1000 chars or (line ernal to fgets) $outAttachmentHeader .= fgets( $textFile,1000); } //--close file fclose($textFile); $outAttachmentHeader .= \"n\"; } //--NON-TEXT use 64-bit encoding { //--format header $outAttachmentHeader .= \"Content-Type: \".$contentType. \";n\"; $outAttachmentHeader .= \' name=\"\'.basename($inFileLocation). \'\"\'. \"n\"; $outAttachmentHeader .= \"Content-Transfer-Encoding: base64n\"; $outAttachmentHeader .= \"Content-Disposition: attachment;n\"; //--other: inline $outAttachmentHeader .= \' filename=\"\'.basename($inFileLocation). \'\"\'. \"nn\"; //--call uuencode - output is ed to the .gif' /> exec( \"uuencode -m $inFileLocation nothing_out\",$Array); //--add each line ed for ($i = 1; $i<(count($Array)); $i){ $outAttachmentHeader .= $Array[ [1][2][3][4][5][6][7][8][9]下页 0
相关文章读者评论发表评论 |