Yes, the first 3 characters in the file are different (but as you can see they do exist in the original text file). The reason they are different is probably due to codepage conversion that occurs when the Email service submits a STAF FS GET FILE <filename> TEXT request (which must be done for TextAttachments) to get the contents of the text file on the process machine. These characters are probably not part part of the supported codepage that STAF is using on your Email service machine (and get transformed to ? or whatever). As described in section "8.4.6 GET FILE" in the STAF User's Guide, the TEXT option specifies to convert line-ending characters in the file being retrieved as specified via the FORMAT option and to perform codepage conversion.
-------------------------------------------------------------- Sharon Lucas IBM Austin, luc...@us.ibm.com (512) 286-7313 or Tieline 363-7313 From: Cindy Zhu <c...@fekete.com> To: Sharon Lucas/Austin/IBM@IBMUS Cc: "staf-users@lists.sourceforge.net" <staf-users@lists.sourceforge.net> Date: 05/05/2011 04:24 PM Subject: RE: [staf-users] Extra characters in the email attachment The image in the previous email was too big. I attached a smaller one here. Thanks, Cindy From: Cindy Zhu Sent: May-05-11 3:14 PM To: Sharon Lucas Cc: staf-users@lists.sourceforge.net Subject: Re: [staf-users] Extra characters in the email attachment Hi Sharon, I downloaded a binary file viewer to view these two files, and did a comparison between their binary code( I attached a bitmap of the comparison). you can see from the image that the binary files are different at the very beginning. I was wondering if the STAF email service change the file? Thanks, Cindy From: Sharon Lucas [mailto:luc...@us.ibm.com] Sent: May-05-11 1:06 PM To: Cindy Zhu Cc: staf-users@lists.sourceforge.net Subject: Re: [staf-users] Extra characters in the email attachment If you use a "smart" editor like Visual SlickEdit, etc (e.g. not notepad), to view the original text attachment file Harmony_Win72.txt, you'll see that it contains extra characters at the very beginning. So, the email service is simply sending the file contents and the original text file does indeed contain extra characters at the beginning. Note that the characters may not be part of the supported codepage on your Email service machine (and when viewed by an editor that doesn't support the characters, they may appear to not be there, e.g. such as if using notepad). If you don't want the extra characters in the attachment, then you'll have to remove them from the file. For example, when I view the original text attachment file Harmony_Win72.txt that you provided via Visual SlickEdit, it shows the extra characters: -------------------------------------------------------------- Sharon Lucas IBM Austin, luc...@us.ibm.com (512) 286-7313 or Tieline 363-7313 From: Cindy Zhu <c...@fekete.com> To: "staf-users@lists.sourceforge.net" <staf-users@lists.sourceforge.net> Date: 05/04/2011 04:14 PM Subject: [staf-users] Extra characters in the email attachment Hi, I have the following code to send out an email with two attachments. The original text attachment sent is Harmony_Win72.txt, but in the attachment received, which was renamed to Harmony.txt, has extra characters at the very beginning. Can you tell me why and help me to fix that? I really want the attachment exactly like the original copy. Thanks, Cindy <script> from com.ibm.staf import STAFUtil emailTo = 'c...@fekete.com' #owner of the automation scripter emailFr = 'c...@fekete.com' emailSubject = PRODUCT + ' ' + VERSION + ' Automation Test Results' emailMessage = 'Attached is the Silk run results on 64 bit Win7.' emailEmptyMessage = 'No Silk run results on 64 bit Win7. Time out occurred.' emailAttachmentMachine = '1451W7.Fekete.com' # Machine where attachment files are located silkResult = 'D:\\Silk\Apps\Harmony\TestResults\Harmony_Win72.txt' bmp = 'D:\\Silk\Apps\Harmony\TestResults\LastScreenShot.bmp' </script> <sequence> <!-- The following is to send email to QAs, LPs, and TAs with Silk result and snapshot on the 64-bit Win7 test client--> <stafcmd name="'Sending email to the QA, LPs, and TAs'"> <location>'local'</location> <service>'EMAIL'</service> <request> 'SEND TO %s SUBJECT %s MESSAGE %s ATTACHMENTMACHINE %s TEXTATTACHMENT %s BINARYATTAcHMENT %s' \ % (emailTo, STAFUtil.wrapData(emailSubject), STAFUtil.wrapData(emailMessage),STAFUtil.wrapData(emailAttachmentMachine), \ STAFUtil.wrapData(silkresult),STAFUtil.wrapData(bmp)) </request> </stafcmd> [attachment "Harmony.txt" deleted by Sharon Lucas/Austin/IBM] [attachment "Harmony_Win72.txt" deleted by Sharon Lucas/Austin/IBM] ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users[attachment "BinaryDifference.gif" deleted by Sharon Lucas/Austin/IBM]
<<image/gif>>
------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users