Rename attachment filename

Hi,
I have a watched folder that read a pdf file into document variable in a workflow. In the workflow, the document is copy to an attachment. The problem is that, the filename of the attachment is alway "attach0". How can i change the filename before attach to the workflow?
I tried setDocAttribute with attribute name "filename", "name", or "file". None of them work.
Thank you for any help.

use one of the document object function called setDocumentAttribute. This function takes the document,the attribute to set,attributeProperty
so to set the filename of the attachment you would use
setDocumentAttribute(/process_data/documentTochange,"wsfilename","NewName.pdf")
The document functions can be found in the xpath builder in workbench
Any further question do let me know
thanks

Similar Messages

  • Not renaming attachment xml file name in receiver mail adapter

    Hi,
    I receive SOAP from GRC and need send to Partner an email.
    I have  SOAP to MAIL scenario where an xml file is picked up and transformed and zipped into the target format in XI which has to be sent as an attachement in an email on the receiver side.
    I am getting the mail with the attachement. But I would like to rename the attachment as the name "NFE.XML" and the ZIP File as the name "nfe.zip"
    I am using MAIL adapter with Modules above.
    Number  Module Name                                                                          Module Type                       Module Key
    1             AF_Modules/PayloadSwapBean                                           Local Enterprise Bean        Transform
    2             AF_Modules/MessageTransformBean                                  Local Enterprise Bean        ContentType
    3             AF_Modules/PayloadZipBean                                                Local Enterprise Bean        zip
    4             sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean    Local Enterprise Bean        mail
    Module Configuration :
    Module Key                           Parameter Name                Parameter Value
    Transform                             swap.keyName                 payload-name
    Transform                             swap.keyValue                 NFE
    ContentType                         Transform.ContentType    application/xml; name="NFe.xml"
    zip                                         zip.filenameKey                ContentType
    zip                                         zip.mode                           zip
    I  am using transport protocol  "XIPAYLOAD" and set  "KEEP ATTACHMENTS"
    I have with result example above :
    Name from ZIP              :  PayloadName.zipu200E(4KB)u200E
    Name from attachment :  PayloadName
    Regards,
    Ricardo

    Hi Shobhit,
    The module tab of your mail adapter will look like this.
    Processing Sequence
    Module Name                                                            Type                                      Module Key
    localejbs/AF_Modules/MessageTransformBean   rename LocalEnterpriseBean     
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean  mail     Local EnterpriseBean     
    Module Configuration
       Module Key               Parameter Name             Parameter Value
          rename      Transform.ContentDescription                      File
          rename  Transform.ContentDescription  attachement;filename="yourfilename.ext"                                                          
          rename            Transform.ContentType                 application/text;name="yourfilename.ext"
    Thanks
    Amitanshu

  • Renaming attachment file name in receiver mail adapter

    Experts,
    I have a file to mail scenario where an xml file is picked up and transformed into the target format in XI which has to be sent as an attachement in an email on the receiver side.
    I am getting the mail with the attachement. But I would like to rename the attachment as the name of the picked up file.
    I am using Adapter specific message attributes on both sides but the attachment is named as untitled.xml.
    Please advise. Can this be achieved by using the swap bean or the message transform bean?
    Regards,
    Shobhit

    Hi Shobhit,
    The module tab of your mail adapter will look like this.
    Processing Sequence
    Module Name                                                            Type                                      Module Key
    localejbs/AF_Modules/MessageTransformBean   rename LocalEnterpriseBean     
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean  mail     Local EnterpriseBean     
    Module Configuration
       Module Key               Parameter Name             Parameter Value
          rename      Transform.ContentDescription                      File
          rename  Transform.ContentDescription  attachement;filename="yourfilename.ext"                                                          
          rename            Transform.ContentType                 application/text;name="yourfilename.ext"
    Thanks
    Amitanshu

  • Can't get the attachment filename out of a Part (with non ascii characters)

    Hello, all and happy new year :)
    My issue is with non ascii filename in attachments... Yes i've read the FAQ : http://www.oracle.com/technetwork/java/faq-135477.html#encodefilename
    I can't get the filename out of the BodyPart for those kind of attachments
    here's my unit test :
         * contains various parts from various mailer encoded in different ways...
         private enum EncodedFileNamePart{
              OUTLOOK("Content-Type: text/plain;\n name=\"=?iso-8859-1?Q?c'estd=E9j=E0no=EBl=E7ac'estcool.txt?=\" \nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename=\"=?iso-8859-1?Q?c'estd=E9j=E0no=EBl=E7ac'estcool.txt?=\" \n\nnoel 2010\n","c'estdéjànoëlçac'estcool.txt"),
              GMAIL("Content-Type: text/plain; charset=US-ASCII; name=\"=?ISO-8859-1?B?ZOlq4G5v62znYWNlc3Rjb29sLnR4dA==?=\"\nContent-Disposition: attachment; filename=\"=?ISO-8859-1?B?ZOlq4G5v62znYWNlc3Rjb29sLnR4dA==?=\"\nContent-Transfer-Encoding: base64\nX-Attachment-Id: f_giityr5r0\n\namluZ2xlIGJlbGxzIQo=\n","déjànoëlçacestcool.txt"),
              THUNDERBIRD("Content-Type: text/plain;\n name=\"=?ISO-8859-1?Q?d=E9j=E0no=EBl=E7acestcool=2Etxt?=\"\nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename*0*=ISO-8859-1''%64%E9%6A%E0%6E%6F%EB%6C%E7%61%63%65%73%74%63%6F;\n filename*1*=%6F%6C%2E%74%78%74\n\njingle bells!\n","déjànoëlçacestcool.txt"),
              EVOLUTION("Content-Disposition: attachment; filename*=ISO-8859-1''d%E9j%E0no%EBl.txt\nContent-Type: text/plain; name*=ISO-8859-1''d%E9j%E0no%EBl.txt; charset=\"UTF-8\" \nContent-Transfer-Encoding: 7bit\n\njingle bells\n","déjànoël.txt"),
              String content=null;
              String target=null;
              private EncodedFileNamePart(String content,String target){
                   this.content=content;
                   this.target=target;
              public Part get(){
                   try{
                   ByteArrayInputStream bis = new ByteArrayInputStream(this.content.getBytes());
                   Part part = new MimeBodyPart(bis);
                   bis.close();
                   return part;
                   catch(Throwable e){
                        return null;
              public String getTarget(){
                   return this.target;
         @Test
         public void testJavamailDecode() throws MessagingException, UnsupportedEncodingException{
              System.setProperty("mail.mime.encodefilename", "true");
              System.setProperty("mail.mime.decodefilename", "true");
              for(EncodedFileNamePart part : EncodedFileNamePart.values())
                   assertEquals(part.name(),MimeUtility.decodeText(part.get().getFileName()),part.getTarget());     
    I take a NullPointerExcepion in the decodeText because getFileName() return null for the EVOLUTION case, and work well with OUTLOOK, THUNDERBIRD and GMAIL.
    Evolution's content type is "Content-Disposition: attachment; filename*=ISO-8859-1''d%E9j%E0no%EBl.txt" wich doesn't look like the other (looks like the RFC 2616 or RFC5987 to do it.)
    How can i handle this situation except by writting my own decoder?
    Thanks for your answers!
    Edited by: user13619058 on 4 janv. 2011 07:44

    Set the System property "mail.mime.decodeparameters" to "true" to enable the RFC 2231 support.
    See the javadocs for the javax.mail.internet package for the list of properties.
    Yes, the FAQ entry should contain those details as well.

  • Mail Adapter: original Attachment filename retrieval in Proxy

    Hi,
    I have a Sender Mail Adapter, and the receiver is a proxy, where I need to get the attachment and its details.
    When I execute
    attachment_filename = l_attachment->GET_DOCUMENT_NAME( ).
    it simply returns Attachment-1 etc.
    How do I get the original attachment filename?
    I am on SP16.  
    Regards,
    Puloma.

    HI
    Please refer tihs thread for mail attchments
    Re: Handling attachments of mail
    Scenario to pick the mail with its attachments into XI\Re: Infrastructure required for Mail Adapter

  • Retrieval of attachment filename - receiver mail adapter

    Hi,
    I am using the mail adapter to receive an e-mail into PI. This e-mail has an attached CSV file.
    First, I am using the PayloadSwapBean to swap the application playload to the attachment payload
    Second, I am using the MessageTransformBean to transform the CSV file into an XML document
    These are both working fine and the message is then passing into the relevant message mapping.
    However, I would like to be able to use the attachment filename in the message mapping.
    Can anyone advise how to do this for the mail adapter ?
    I've done it loads of times for the file adapter but never the mail adapter (when using attachments) so I am a bit stumped.
    Any advice greatly received.
    Cheers
    Colin.

    Hi Progirl,
    I want to dynamically set the name of attachment in receiver mail Communication Channel.
    Example: IN__9907211000004_4048454000005_20081211_01000000002643
    The first two numbers 9907211000004 & 4048454000005 I want to read it from the message
    20081211 this is the date and
    And againg this number 01000000002643 is read from message.
    I read from your response. You had created adapter module for the similar purpose. Can you share it. Since I am new to  writing Adapter Module.
    Thank You in Advance.
    Mukhtar

  • ("Content-Disposition", "attachment;filename=x") works in Netscape; not IE.

    I'm sending an ASCII file back to the client using the following method:
    private void sendFile(String fullFilePath, HttpServletResponse res) {
    if(fullFilePath!=null) {
    try {
    res.setContentType("application/text/plain"); //this will be an unknown type
    res.setHeader("Content-Disposition", "attachment;filename=" + fullFilePath);
    FileInputStream fi = new FileInputStream(fullFilePath);
    OutputStream out = res.getOutputStream();
    while(true) {
    int d = fi.read();
    out.write(d);
    if(fi.available()==0)
    break;
    fi.close();
    out.close();
    catch (Exception e) {
    Logger.err.println("Error in TableQueryServlet.sendFile(): " + e,Log.ERROR);
    This works great in Navigator. The filename that it defaults to in the Save file dialog box is the same one I set it to using the fullFilePath string - including the .txt extension. However, in IE it ignores my filename and assigns its own random filename. Any ideas how I can get this to work in IE?

    It's not the greatest, but see the following...
    MS knowledgebase # Q279667

  • Submit Form as XML / Rename attached XML file

    Hello,
    I am using the followig script to submit a form:
    var Mailto = "[email protected]";
    var mySubject = "This is the subject";
    var myMessage  = "Please find attached my file.";
    var Mail = "mailto:" + Mailto + "?Subject=" + mySubject + "&Body=" + myMessage;
    event.target.submitForm({
    cURL: Mail,
    bEmpty: true,
    cSubmitAs: "XML"
    Unfortunately I cannot change the name of the attached XML file. It is automatically the PDF filename.
    Has anybody an idea how to change the attachement name?
    Many thanks.
    Regards,
    ra_be

    The attachment filename will always be the name of the PDF. The only way to change is to save the PDF under a different name before you email it.
    Paul

  • Broadcasting Workbook - Change attachment filename

    Software component : BW release 3.5 SP 16
    HI guru,
    we're using Information Broadcasting to distribute precalculated workbooks as attachments (xls-files) to our end users.
    The attachment file in the outsent mail has a generated file name with the following structure :
    workbook_<technical workbook name>.xls
    We have the problem to discern through filename the different workbooks sent with different parameter because the name is always the same.
    So we want to change the generated attachment filename to a more meanful name.
    Does anybody has a way to solve this problem?
    Kind Regards
    Stefano

    Hi,
    the filename is defined in CLASS CL_RSRD_PRODUCER_EXCEL
    on Method PRODUCE
    the code is:
        CONCATENATE 'WORKBOOK_' l_wbid '.' l_creation_type INTO l_sx_document-root-file_name.
    No user exit exist on this part.
    No substitution of variable is possible on that (like rsrd_attr table).
    I'm sorry,
    Regards,
    Sergio

  • Information Broadcaster- change attachment filename

    Hello,
    we're implementing Information Broadcasting to distribute csv-files to our information-consumers.
    Now we have the problem that we want to change the generated attachment filename to a more meanful name.
    Does anybody has a way to solve this problem?
    With kind regards Markus

    HI MArcus,
    Can you please explaint the problem/requirement in detail again?
    Hi Gillan Leo,
    If you don't want to display the footers in the broadcasted email then you  can hide or remove it with settings. Please follow the below path and select for no footer.
    SPRO -> SAP Reference IMG -> SAP Netweaver -> Business Intelligence -> Setting for Reporting and analysis->Settings for Information Broadcasting-> Settings for Distributing E-Mails.
    Please assign points if helpful.
    Thanks,
    Sasi

  • Can I send a renamed attachment?

    I often send an attachment to other people where I understand the name of the file, but for it to be useful for the person on the other end, it should have a more descriptive title. Often this is because the file resides in a folder which contains those descriptors. An example might be: Dave/Project A/Outline.doc --- If I send this file "Outline.doc" and the person saves it to the disk without organizing or changing the name, they may not later be able to correlate it with me or with project A. If I could, I would leave the file named as it is on my computer, but when attaching it, I would give it a different name, like "Dave's outline for Project A.doc" ... That way I'm not changing the file on my computer, but the person receiving it is getting a file which actually describes what is in the attachment. And they still have the opportunity to organize it into an appropriate folder or rename it as they wish. Is there an add-on which can do this? If not, is this a feasible add-on project? I do not have the programming chops to create such an add-on myself, but perhaps someone out there does.

    Thanks for the reply.
    Not to sound ungrateful, but I really do know many ways to manipulate a file (copy it and rename it, then send; or rename and send then change it back; or start with a descriptive name and just put up with having filenames that go off the side of the screen all the time and give up on folders); The question wasn't how can I do this: it was, is there an add-on that would be able to automate that process in some way? So, if someone has an answer to ''that'' question, I would appreciate it! So, christ1: your answer could just as easily have been "no, I don't know how to do that."
    You know, if I was on a Mac, I bet I could create an applescript that would trigger every time I sent an attachment. It would store the old name in memory, ask me to rename the file, attach it to an e-mail, then undo the renaming after the e-mail was sent. Of course, I'd be using Apple's Mail program then, and not Thunderbird, however. Anyways; any other ideas out there?

  • B2B attachment filename having space in UNIX server.

    Hello B2B Gurus,
    I am working on B2B for Rosettanet.
    It also sends the attachment picked from UNIX server along with PIDX format payload.
    If the file name in the UNIX server has a space, Rosettanet along with attachment errors out with
    B2B-51570-
    Machine Info: (hou-ecmsoatst01.swn.com)
    Description: Attachment error
    If the file name does not have any space, the attachment logic works file.
    I used the below link for reference, which was really helpful to attain attachment logic.
    http://anuj-dwivedi.blogspot.com/2011/04/rosettanet-attachment-handling-in.html.
    Can anyone help me to handle filename with space in UNIX server to be sent as attachment.
    Thanks,
    Sunil

    Can you try to escape space with %20 ? For e.g. if file path is file:///b2b file/OrderBill.pdf then provide it as file:///b2b%20file/OrderBill.pdf
    Regards,
    Anuj

  • Reading Attachment FileName in Japanese

    Hai,
    I am Using POP3 for Reading the mail.
    If the mail having attachment , i had get the file name and create the file in the server.
    I have encounter the below problem, when getting the file name in japanese
    if (message.isMimeType("multipart/*"))
    Multipart mp = (Multipart)message[i].getContent();     
         for (int j=0; j<mp.getCount(); j++)
         Part part = mp.getBodyPart(j);
    attachFileName=part.getFileName();
    If the filename is �T���v��.jpg
    I am getting like this iso-2022-jp?B?GyRCJTUlcyVXJWsbKEouanBn?=
    I have tried the below Encoding conversion
    attachFileName= new String(part.getFileName(i).getBytes("8859_1"), "JISAutoDetect");
    attachFileName= new String(part.getFileName(i).getBytes("iso-2022-jp"), "JISAutoDetect");
    still it's not working.
    Expecting Your Feedback.
    Please Help.
    R.vijay.

    attachFileName= new String(part.getFileName(i).getBytes("iso-2022-jp"), "JISAutoDetect");
    try
    attachFileName= new String(part.getFileName(i).getBytes("utf-8"), "JISAutoDetect");
    attachFileName= new String(part.getFileName(i).getBytes("utf-16"), "JISAutoDetect");

  • Renaming identical filenames in photos -how?

    How do I rename photos with identical names in iPhoto 5?
    I'm trying to clean up and organize my photos, so I first held down ALT and COMMAND while starting iPhoto which gave me 4 choices to clean up/rebuild stuff, which I did.
    When it was all done several images were added to my library. I'm guessing photos that were otherwise buried/hidden from various crashes/forced exits, so what I'm going to do is drag them to the desktop, then drag the ones that I don't have duplicates of back to the iPhoto albums.
    The problem is that I'm not able to drag many of those photos to an empty folder on the desktop because their filenames are identical. How do I fix that?

    I found this very strange, so I had to check for myself by creating a brand new library (using "libra") and adding 3 RAW images to it. After quitting iPhoto I investigated the new library's folders and sure enough -there were JPGs to be found! Full-size JPGs and thumbnail JPGs. And within a folder named "Originals" I found the RAW image files.
    When I take pictures with my camera I shoot RAW and .JPG simultaneously, which means that when importing my memory card into iPhoto I get both.
    By copying the library and removing the JPGs from one and RAWs from the other I figured that I would have split things up, but apparently not as from what you say I have double up with JPGs (one being the actual imported JPGs, the other copy being a converted RAW image representing the RAW image).
    But if I delete the RAW images from the library, wouldn't the JPGs representing them also be deleted?
    I will take your suggestion of importing my memory card's images to the computer's desktop (preferrably in an empty folder of course) instead of directly into iPhoto, then importing just the JPGs into the "JPG library", and the RAW images into a separate "RAW only" library as I've intended by splitting up the existing library into two.
    I haven't used my RAWs much so far, but like to keep them as "lossless digital negatives". If I find an image in my JPG library that I would like to have the RAW equivelant of I'll just take note of the filename/date, switch over to the RAW iPhoto library and find it there.
    But back to my problems with duplicated files. I don't think the main problem is that I've imported RAWs (and certainly no problem if the JPGs representing the RAWs are deleted along with the deleted RAWs), but rather "leftovers" from times I've had to force-quit iPhoto while importing or otherwise (I assume that iPhoto keeps images that are imported even if the program crashes afterwards, or forced to quit, but possibly messing up the organizing of things).
    I say this because the many of the images that showed up after I rebuilt the library etc. had strange names such as "roll 235 -587", and that's definitely not an original photo's file-name as they all start with "IMG_" (both JPGs and RAW).
    Another thing is that when I look through some of the iPhoto folders (from the Finder) there are files with very strange looking names. Generic white icons with long number codes as file-names (e.g. "F49B1A72-6B81-11DB-88BB-00145119B97A-11152-0000005623827527").
    Could these be corrupt files that I should throw in the trash, then rebuild my iPhoto library (holding down ALT-COMMAND while starting it), or are those files that iPhoto actually needs all the time?
    As far as I could see when using iPhoto itself was that these additional images that showed up after rebuilding were photos that I already had from before, and that these were just re-imported, but I need to be 100% sure before I delete anything, and that means manually inspecting each photo. And that's a hard thing to do if I can't copy them to the desktop etc.
    I can't be the first one having this problem...
    Regarding memory I have 1.5 Gbytes RAM, and usually don't run many applications at once. Seeing how "unresponsive" iPhoto is I usually quit everything else when I use it.
    I don't feel like forking out any more cash on newer versions when I haven't yet pushed what I have to its limits and really need something new.
    Apple has a way of adding a few "must have" features to every new version of something to attract users to upgrade. Eyecandy or other small enhancements which really don't make much of a difference.
    I'll see how much I can get done with iphoto 5 first.

  • Possible to show complete attachment filename when printing?

    I know, it's a feature, not a bug.
    Most of the attachments we use in the office have very long filenames (often up to the 31 character limit).
    Mail abbreviates the filename when displaying the attachment icon. That's fine, I can mouse over to see the entire filename.
    But when I print an email, it prints the abbreviation. I'd like to be able to see the entire filename. On emails with multiple attachments, it becomes impossible to distinguish which documents are attached if only the first ten characters are visible.
    Is there a way to adjust settings or run a script so that all attachments can display a full filename?

    it is in fact the same as the bin file for installing
    java, when you extract that you see the license
    agreement and the user has to press enter to go on,
    that's the only input.
    You're right, i should read the out and err, i
    forgot, stupid of meYou have to send enter to the input stream of the process in that case.
    Kaj

Maybe you are looking for