Attachment Name in Content Type

Hi All,
I am doing a scenario where I receive messages from ABAP - SRM system through proxy(which isXI sender adapter) . The message contains set of attachments as well . I have certain manipulations to do before sending the attachments to the receiver system which is a third party . The attachments are taken into one of the fields of the target message as base encoded string and sent to the third party. For certain manipulations I need the attachment names . I tried to get the attachment name from runtime by using the method getContentType but it doesnt solve my purpose. But is there a way I can put in the attachment name in content type so that I can get the attachment name using getContentType method.
I am dealing with a scenario where in I will be strictly using ABAP stack from the sender side ( no java adapters) .
Can anyone guide me in this case as I am stuck with no ideas .
Regards
Nishant Kumar Singh

Hello Nishant,
You can acccess names, contents and encoding of the attachments within a message mapping via the Global Container Object
of the Message Mapping API (Check out the mehtod "getInputAttachments() " of global Container in the official SAP Javadoc: http://help.sap.com/javadocs/pi/SP3/xpi/index.html).e.
Best regards
               Sebastian

Similar Messages

  • Attachment without multipart content type

    Hello,
    My application receives mails sent from some different customers and parses the mail's attachments. The problem is that all these customers send their mails in a very different ways. Some of them send mails with "Content-Type: multipart/mixed;" header while some others send mail with the following headers (among some other):
    MIME-Version: 1.0
    Content-Type: application/xml
    Date: Tue, 11 Feb 2014 18:33:26 +0000
    From: <[email protected]>
    Message-ID: <1392143606.220.1@cls0361>
    Subject: orders000005311382.xml
    To: <[email protected]>
    There is no "Content-Type: multipart/mixed;" header at all. When I look at these messages with MS Outlook I can see that they have proper attachements.
    Now I have 2 problems:
    1. I would like to produce such an email myself since resending the received emails changes the message headers. There are lots of examples how to send a message with an attachment in Java with MimeMultipart object (this produces "Content-Type: multipart/mixed;") but I could not find one which sends the message with "Content-Type: application/xml" header only without any multipart header. I suspect that there are some specific applications which send mails in that way - not standard mail clients.
    2. I would like to get the attachment of a received mail with "Content-Type: application/xml" header. The following code works for "Content-Type: multipart/mixed;" only:
    public void invoke() throws Exception {
      /* Available Variables: DO NOT MODIFY
        In  : String mimeMessage
        In  : String encoding
        Out : String[] mimeParts
      * Available Variables: DO NOT MODIFY *****/
      javax.mail.util.ByteArrayDataSource ds = new javax.mail.util.ByteArrayDataSource(mimeMessage, "multipart/mixed");
      javax.mail.internet.MimeMultipart mm = new javax.mail.internet.MimeMultipart(ds);
      java.util.ArrayList<String> al = new java.util.ArrayList<String>();
      getAttachements(mm, al, 1);
      mimeParts = new String[0];
      mimeParts = al.toArray(mimeParts);
    private void getAttachements(javax.mail.internet.MimeMultipart mm, ArrayList<String> al, int depth) throws Exception {
      if (depth > 9) {
        return;
      int mimePartsCount = mm.getCount();
      for (int i = 0; i < mimePartsCount; i++){
        javax.mail.internet.MimeBodyPart mbp = (javax.mail.internet.MimeBodyPart)mm.getBodyPart(i);
        //System.out.println(depth + ": " + mbp + " " + mbp.getContentType() + " " + mbp.getContentID() + " " + mbp.getDisposition());
        if(mbp.getContentType().startsWith("multipart")){
          javax.mail.util.ByteArrayDataSource ds2 = new javax.mail.util.ByteArrayDataSource(mbp.getInputStream(), "multipart/mixed");
          javax.mail.internet.MimeMultipart mm2 = new javax.mail.internet.MimeMultipart(ds2);
          getAttachements(mm2, al, depth+1);
        } else {
          if (mbp.getDisposition() != null && mbp.getDisposition().startsWith("attachment") && !mbp.getContentType().contains("signature")){
            BufferedReader br = new BufferedReader(new InputStreamReader(mbp.getInputStream(),encoding));
            String s = br.readLine();
            StringBuffer sb = new StringBuffer();
            while (s != null) {
              sb.append(s);
              s = br.readLine();
            al.add(sb.toString());
    Could anyone suggest anything which may be helpful for resolving 1 or 2?
    Best regards

    You are right! parsing of such not-multipart mail may look like that:
    if (contentType.startsWith("application/xml")) {
                //just a plain attachement which is a mail's content and not a multipart.
                mimeParts = new String[1];
                //according to RFC 2822 empty line separates headers from the body
                mimeParts[0] = mimeMessage.substring(mimeMessage.indexOf("\n\r")).trim();
    } else {
                //multipart mail
                javax.mail.util.ByteArrayDataSource ds = new javax.mail.util.ByteArrayDataSource(mimeMessage, "multipart/mixed");
                javax.mail.internet.MimeMultipart mm = new javax.mail.internet.MimeMultipart(ds);
                java.util.ArrayList<String> al = new java.util.ArrayList<String>();
                getAttachements(mm, al, 1);
                mimeParts = new String[0];
                mimeParts = al.toArray(mimeParts);
    Thanks!

  • Attach a custom content type and set as default for picture library using client object model

    Hi,
    How to associate custom content type to a picture libraray and set it as default using the client object model?
    Thanks

    Hello,
    Here you go:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/b1de0697-0006-4f89-8909-1b94aa18ad89/how-to-reorder-content-types-in-list-with-client-context
    http://www.niteenbadgujar.com/2013/05/change-default-content-type.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • REST Query to Get Content Type Name

    I'm just getting started learning to use the SharePoint REST interface.  One of the first things I'd like to do is return the content type name for a list item in a document library (the document library is configured with several content types).  From
    what I've read, it looks like I need to use the $expand query option.  So, my REST query looks like this:
    http://localhost/_api/web/lists/Documents/Items()?&$select=ContentType/Name&$expand=ContentType/Name
    But it's not working.  I can't "dig" out the content type name property.  In other words the $expand query option is not working.  I just receive the following which includes a link to the content type: 
      <entry m:etag="&quot;2&quot;">
        <id>4078e129-ac4b-44b8-b469-bcc083f2268d</id>
        <category term="SP.Data.DocumentsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
        <link rel="edit" href="Web/Lists(guid'cd710fd1-057e-4ee7-b0bd-1f014218ea3e')/Items(36)" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'cd710fd1-057e-4ee7-b0bd-1f014218ea3e')/Items(36)/ContentType"
    />
        <title />
        <updated>2013-04-12T00:16:26Z</updated>
        <author>
          <name />
        </author>
        <content type="application/xml" />
      </entry>
    I've tried difference variations and if I just use "$expand=ContentType" then I get all the list items with the content type fully expanded within each item.
    What am I missing?

    It's been awhile since this question got asked, but I figured i'd post for anyone who happens to stumble
    on it.
    Try this:
    http://localhost/_api/web/lists/Documents/Items(<item
    id>)/ContentType?$select=Name

  • ECB Menu item for all CTs (Content Types) except folders (Without hardcoding CT names)

    Hi there,
    How to have an ECB menu item for all items only (and not on Folders).
    I canNOT hardcode the names of Content Types.
    Thanks.

    Have you tried using base content type id?
    http://social.technet.microsoft.com/Forums/en-US/cd63795b-9659-4b35-a023-c007398252a1/hidedisable-ecb-menu-for-particular-selection-in-document-library
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • I need help using multiple content types in a wiki page library

    I currently trying to used multiple custom content types based off of the wiki page content type in one wiki page library. 
    EDIT: "Allow management of content types" has been enabled with the designer
    The way i would like this library to work is:
    Click the "Files" tab in the ribbon
    Click the "New Document" drop down menu
    Select one of the content types (Client, Contact, Project)
    SharePoint Will Ask for the Page Name and content type fields
    Click create
    Then it will take you to the new created page.
    This issue I'm currently having is when i click on one of the options (Client, Contact, Project) it will ask for a page name then you have to check it in to get to the edit form. The edit form it then loads is the default content type and not the selected
    content type.
    So my questions are.
    Is there any way i can combine the page name and edit steps together into one step?
    How can I get the edit form to pull from the selected content type?
    Thanks in advanced
    James T.F

    Wiki library isn't really designed for customizations... it's a "special" library that overrides a lot of default behavior... similar evidence can be found if you're trying to add metadata columns to wiki pages... they're just not really designed to handle
    it very well.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • SharePoint REST service to add an exsiting site content type to a list/library

    Trying to use SharePoint 2013 REST Service to add existing site content types to a list/library. Below MSDN article suggests that the POST method is available but does not say how to use it.
    http://msdn.microsoft.com/en-us/library/office/jj246793%28v=office.15%29.aspx#postsyntax_htm
    POST http://<sitecollection>/<site>/_api/web/lists(listid)/contenttypes/add(parameters)
    How do we create the body for this rest call?

    Hi You need to use the addAvailableContentType method to attach a Existing Content Type to a list/Library.
    Consider the below Sample. Take the Id of the Content Type and pass it.
    the REST API URL is 
     http://<sitecollection>/<site>/_api/web/lists(listid)/contenttypes/addAvailableContentType(contentTypeId)
    var siteUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Employees')/ContentTypes/AddAvailableContentType";
        var call = jQuery.ajax({
            url: siteUrl,
            type: "POST",
            data: JSON.stringify({            
                "contentTypeId": "0x0100E5EC1FE6D284A74A972A1776FFFE2DA0"            
            headers:
                   'accept': 'application/json;odata=verbose',
                    "content-type": "application/json;odata=verbose",
                    "X-RequestDigest": jQuery("#__REQUESTDIGEST").val()
        call.done(function (data, textStatus, jqXHR) {
            var message = jQuery("#message");
            message.text("Added Content Type Successfully");
        call.fail(function (data, errorcode, errormessage) {
            alert("Could not enable content types: " + errormessage);
    Here 0x0100E5EC1FE6D284A74A972A1776FFFE2DA0 is the Content Type Id of my existing Content type "Employees"
    Ensure the AllowContentTypes is set to True for that List/Library
    R.Mani | http://rmanimaran.wordpress.com

  • How to set Content-Type of attachment?

    Does anyone know how I can set the Content-Type of an attachment of an outgoing mail?
    I use Apple Mail, and with one correspondent I have this annoying problem that he never receives any excel or word attachments that I send (and possibly other ones, too).
    Our support now says that I should try to set the Content-Type
    of the excel attachments to "Content-Type: application/vnd.ms-excel".
    Apple Mail seems to set it to
    "Content-Type: application/octet-stream"
    and they think that attachments with this content-type might get blocked by the mail server of my correspondent.
    Any suggestions, ideas, etc., will be appreciated.
    Best regards,
    Gabriel.

    Thanks a lot for your test.
    Unfortunately, I get
    Content-Type: application/octet-stream;
    when I try to send an excel attachment to myself.
    Below is the beginning of the email (in "source" format).
    Any ideas why you get the correct mime-type, but I don't?
    Regards,
    Gabriel.
    ---------- beginning of email
    Return-Path: <[email protected]>
    Received: from [80.128.100.143] (account xxxxxxx HELO [192.168.2.100])
    by tu-clausthal.de (CommuniGate Pro SMTP 5.2.4)
    with ESMTPSA id 35503032 for [email protected]; Mon, 30 Jun 2008 21:59:05 +0200
    Message-Id: <[email protected]>
    From: Gabriel Zachmann <[email protected]>
    To: Gabriel Zachmann <[email protected]>
    Content-Type: multipart/signed; boundary=Apple-Mail-13-325543015; micalg=sha1; protocol="application/pkcs7-signature"
    Mime-Version: 1.0 (Apple Message framework v924)
    Subject: test
    Date: Mon, 30 Jun 2008 21:59:04 +0200
    X-Mailer: Apple Mail (2.924)
    --Apple-Mail-13-325543015
    Content-Type: multipart/mixed;
    boundary=Apple-Mail-12-325542957
    --Apple-Mail-12-325542957
    Content-Disposition: attachment;
    filename="Kostenabfrage AVILUS Gesamtinklusive_TPxyz 080606.xls"
    Content-Type: application/octet-stream;
    x-mac-creator=5843454C;
    x-unix-mode=0644;
    x-mac-type=584C5338;
    name="Gesamt.xls"
    Content-Transfer-Encoding: base64

  • Getting an Invalid or absent Content-Type exception with soap attachment

    Hi,
    I am trying to send an attachment using Saaj API. As soon as I use the attaachment object and attach it to message I get an exception . If I remove it the over all webservice communication works successfully. Even if I set the content type in the mimeheader explicetely it gives the same error. Any Suggestion how what could be wrong here or how can I fix it please ?
    ++com.inqmy.lib.jaxm.soap.SAPSoapException: javax.xml.soap.SOAPException: Invalid or absent Content-Type++
    ++     at com.inqmy.lib.jaxm.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:169)++
    ++     at com.philips.cms.Main.main(Main.java:261)++
    ++Caused by: javax.xml.soap.SOAPException: Invalid or absent Content-Type++
    ++     at com.inqmy.lib.jaxm.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.java:69)++
    ++     at com.inqmy.lib.jaxm.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:40)++
    ++     at com.inqmy.lib.jaxm.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:160)++
    ++     ... 1 more     ++
    Below is what the program looks like .
    public static void main(String[] args) {
              String nameSpace = "ns";
              String nameSpaceURI = "http://schemas.hp.com/SM/7";
              String comNameSpace = "com";
              String comNameSpaceURI = "http://schemas.hp.com/SM/7/Common";
              String xmNameSpace = "xm";
              String xmNameSpaceURI = "http://www.w3.org/2005/05/xmlmime";
              String endPoint = "http://GBRLONTSYSVW106.code1.emi.philips.com:13088/SM/7/ws";
              try {
                        SOAPConnection soapConnection = SOAPConnectionFactory.newInstance().createConnection();
                        SOAPFactory soapFactory = SOAPFactory.newInstance();
                        MessageFactory messageFactory = MessageFactory.newInstance();
                        // Create a message from the message factory.
                        SOAPMessage soapMessage = messageFactory.createMessage();
                   // start: setting HTTP headers - optional, comment out if not needed
                        String username = "BLAH";
                        String password = "****";
                        String authorization = new sun.misc.BASE64Encoder().encode((username+":"+password).getBytes());
                        MimeHeaders hd = soapMessage.getMimeHeaders();
                        hd.removeAllHeaders();
                        hd.addHeader("Authorization", "Basic " + authorization);
                        hd.addHeader("SOAPAction", "Create");
                        // creat a SOAP part have populate the envelope
                        SOAPPart soapPart = soapMessage.getSOAPPart();
                        SOAPEnvelope envelope = soapPart.getEnvelope();
                        envelope.addNamespaceDeclaration(nameSpace, nameSpaceURI);
                        envelope.addNamespaceDeclaration(comNameSpace, comNameSpaceURI);
                        envelope.addNamespaceDeclaration(xmNameSpace, xmNameSpaceURI);
                        // create a SOAP body
                        SOAPBody body = envelope.getBody();
                        Name query = soapFactory.createName("query");
                        Name attachmentInfo = soapFactory.createName("attachmentInfo");
                        Name attachmentData = soapFactory.createName("attachmentData");
                        Name attachments = soapFactory.createName("attachments");
                        Name attachment = soapFactory.createName("attachment");
                        Name model = soapFactory.createName("model");
                        Name keys = soapFactory.createName("keys");
                        Name instance = soapFactory.createName("instance");
                        Name cmsRequestName = envelope.createName( "CreateCaseRequest", nameSpace, nameSpaceURI);
                        SOAPElement soapRequest = body.addBodyElement(cmsRequestName);
                        soapRequest.addAttribute(attachmentInfo, "true");
                        soapRequest.addAttribute(attachmentData, "true");
                        soapRequest.addAttribute(ignoreEmptyElements, "true");
                        SOAPElement soapModel = soapRequest.addChildElement("model",nameSpace, nameSpaceURI);
                        soapModel.addAttribute(query,"?");
                        SOAPElement soapKeys = soapModel.addChildElement("keys",nameSpace, nameSpaceURI);
                        soapKeys.addAttribute(query,"?");
                        SOAPElement soapinstance = soapModel.addChildElement("instance",nameSpace, nameSpaceURI);
                        soapinstance.addAttribute(query,"?");
                        soapinstance.addAttribute(uniquequery,"?");     
                        soapinstance.addAttribute(recordid,"?");
                        SOAPElement soapDescription = soapinstance.addChildElement("Description",nameSpace, nameSpaceURI);
                        SOAPElement soapDescriptionEle = soapDescription.addChildElement("Description",nameSpace, nameSpaceURI);
                        soapDescriptionEle.addTextNode("Test via Saaj");          
                        SOAPElement soapOwnerEle = soapinstance.addChildElement("Owner",nameSpace, nameSpaceURI);
                        soapOwnerEle.addTextNode("INTERFACE");
                        SOAPElement soapTechStatusEle = soapinstance.addChildElement("TechStatus",nameSpace, nameSpaceURI);
                        File file = new File("C:\\Bati\\Phillips\\test case.txt");
                        System.out.println(file.getAbsolutePath());
                        System.out.println(file.getName());
                        System.out.println(file.getPath());
                        FileDataSource ds = new FileDataSource(file);
                        DataHandler dataHandler = new DataHandler(ds);
                        AttachmentPart attachmentPart = soapMessage.createAttachmentPart(dataHandler);
                        attachmentPart.setContentType(dataHandler.getDataSource().getContentType());
                        attachmentPart.setContentId("test");
                        soapMessage.addAttachmentPart(attachmentPart);
                        // set the saves into the structure
                        soapMessage.saveChanges();
                        // output the message
                        System.out.println( "\n============= start request msg ==========\n" );
                        soapMessage.writeTo( System.out );
                        URLEndpoint urlEndpoint = new URLEndpoint(endPoint);
                        System.out.println( "\nSending message to URL: " + urlEndpoint.getURL() );
                        // now make that call over the SOAP connection
                        SOAPMessage reply = soapConnection.call( soapMessage, urlEndpoint );
                        // output the message reply
                        System.out.println( "\n============= start reply ==========\n" );
                        reply.writeTo( System.out );
                        System.out.println( "\n============= end reply ==========\n" );
                        // close down the connection
                        soapConnection.close();
              } catch (Exception ex) {
                   ex.printStackTrace();
    Thanks,
    Bati.

    I suppose I should also include the bit where the Servlet actually SENDs the resulting SOAPMessage
    SOAPMessage msg = ProcessXML.buildXML(outMessage);
    // try to send it
    try {
         response.setContentType("text/xml");
         msg.writeTo(response.getOutputStream());

  • Issue in creating a add link to a document content type on a doc lib name with , / special characters

    hi,
    i am having a  requirement to create/use "add link to a document" content type for a item in the document library.
    so i got  the code from below site :
    http://howtosharepoint.blogspot.in/2010/05/programmatically-add-link-to-document.html
    my issue is, if teh document  library names are single words - like MOM, model, procedures etc this  functionality is working fine and i am able to view the link to a document as an item. 
    but when the doc lib name contains special characters like , or  /  , this link to a  document  content type functionality is NOT working.
    can anyone pls point me whether this is the  actual  issue ? ie, if  the doc lib name contains special chars  like , or /  my
    add link to a document wont work? is there any restrictions/limitations for doc lib names in SharePoint ?
    for eg: my doc lib names are :
    1) Report and analysis, Data
    2) form / template
    3) map/ plot
    help is highly appreciated!

    hi,
     its talking abt the subsite names and  folders and NOT the document librraies.
     is there any link which gives the naming convention / restricted names for  document libs or  splists , from msdn / blogs.technet.
    thnx

  • Workflow attached to content type shows the status as 'Starting'

    Hi,
    I have developed a workflow to distribute documents from Drop Off library to different SharePoint libraries based on the content type that the document uploaded to.
    The drop off library has been configured incoming mail settings hence the documents would be on boarded to drop off library through e-mails. In this scenario, my workflow should be triggered when the document is on boarded through email.
    Another scenario, the user can upload the document to different content type manually and updates the respective meta data values. This scenario, my workflow should be triggered when the item updated.
    So, I have configured my workflow should run on the content types and trigger when item is created through e-mail and item is updated by manual.
    The document on boarded through e-mails are working fine as soon as the item is created.
    Issue:
    The workflow associated on a content type which needs to be triggered on item created is triggering as soon as the user uploads a document manually and shows the status as 'Starting'.
    The workflow associated on a content type which needs to be triggered on item modified is triggering as soon as the user updating meta data values after document is uploaded. Hence, throwing an error
    'cannot open a file from drop off' library exception when I try to read file using C# code as file stream bytes.
    Configuration:
    1. The content types are having mandatory fields which has a default values set.
    2. The document version settings are set as check out the document when editing the properties.
    Please help me to resolve this bug and let me know if you need more details.
    Also, let me know how can we cancel the workflow if it is in 'starting' mode.
    The workflow should run the document is onboardedwhen an item is created and

    Hi,
    According to your description, my understanding is that you want to get data from content type in JSlink.
    I suggest you can get the content type data in JSLink using JavaScript Client Object Model.
    Here are some derailed code demos for your reference:
    http://sharepoint.aspcode.net/view/635399286724222582163436/sharepoint-how-to-get-field-value-using-jsom-jslink-without-async-call
    http://sharepoint.stackexchange.com/questions/93777/how-to-get-contenttype-name-in-clientsidejavascript-jquery-csom-etc-in-editf
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Select option "Show this View : in Folder of Content type : {Custom Content Type Name}" while creating view using CSOM

    Hi,
    I am trying to create "View" in a Document Library and need to enable following:
    1. Mark as default View
    2. Folders -> Show this view : in Folders of Content Type : {Custom Content Type name}
    I am using following code which sets "in Folders of Content Type : " to "Folder" rather than selecting custom content type despite passing Content Type ID of custom content type.
    code:
    var itemContentTypes = clientContext.LoadQuery(web.AvailableContentTypes.Where(ct => ct.Name == viewContentType));
    clientContext.ExecuteQuery();
    var itemContentType = itemContentTypes.FirstOrDefault();
    view.ContentTypeId = itemContentType.Id;
    view.DefaultViewForContentType = true;
    view.Update();
    clientContext.ExecuteQuery();
    Please highlight what seems to be missing?
    Thanks
    Sonal

    Hi,
    Before you set the content type ID for the view, you need to add the custom content type to the library firstly.
    You can add the content type to library using OOTB feature “Add from existing site content types” in library settings or using Client Object Model.
    Here is a code snippet for your reference:
    var list = context.Web.Lists.GetByTitle(listTitle);
    list.ContentTypesEnabled = true;
    var contentType = context.Site.RootWeb.ContentTypes.GetById("0x0120");
    list.ContentTypes.AddExistingContentType(contentType);
    context.ExecuteQuery();
    More information about add exist content type using Client Object Model:<o:p></o:p>
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.contenttypecollection.addexistingcontenttype%28v=office.15%29.aspx
    Best regards,
    ZhengyuGuo
    Zhengyu Guo
    TechNet Community Support

  • AS2 File name preseve - can we force the file name to be in Content-Type

    Ref: http://www.b2bgurus.com/2007/11/as2-file-name-preserve-feature.html
    Our TP wants file name to be part of Content-Type of MIME rather than Content-Disposition. is this possible in Oracle B2B?
    Thanks,
    Kalyan

    Hi Ramesh,
    Older applications still use "name" parameter of content-type to identify and further process the document
    I think B2B should provide a way to include "name" parameter as part of content-type for backward compatibility
    Expected by our TP
    Content-Type: application/pdf; name="example.pdf"
    Content-Transfer-Encoding: base64
    few links to throw some more light on the topic
    http://osdir.com/ml/ietf.rfc822/1996-03/msg00000.html
    http://pear.php.net/bugs/bug.php?id=4057
    h3. expert from wiki
    The original MIME specifications only provided a means to associate filenames with application/octet-stream parts. This was done through the use of a name= parameter on the content-type. The theory here was that filenames were mostly used for type information and therefore did not need to be present in most cases. It was a mistake. The specification of content-disposition attempted to provide a more general means of providing file name information by defining a filename parameter as part of the content-disposition field

  • How to set content type for the attachment?

    Hello Everybody,
    I was trying to do the following in my send mail program:-
    1. I am making a file using FileWriter:
    FileWriter fw = new FileWriter(f);
    fw.write(str);
    2. I now want to attach this file with my mail. but before that I want to set the Content type of this as "application/smil". and trying the following code:
    mimebodyparts[0].setContent(fds[0],"application/smil");
    As this is a new MIME type perhaps I need to change the mailcap file. I found the same in the activation jar package but thought instead of chagning the default file i tried putting following code in my program:
                  File capfile = new File("simple.mailcap");
                  if (!capfile.isFile())
                        System.out.println("Cannot locate the \"simple.mailcap\" file.");
                        System.exit(1);
                  CommandMap.setDefaultCommandMap( new MailcapCommandMap(new FileInputStream(capfile)));
    and in simple.mailcap file put the following value
    application/smil;;     x-java-content-handler=com.sun.mail.handlers.application_smil  but I am still getting the following error:
    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/smil
    Can somebody Please help to sort this out.
    regards,
    Arun

    //add related mutip-part to combine parts
    MimeMultipart multipart = new MimeMultipart("related");
    //attach a pdf
    messageBodyPart = new MimeBodyPart();
    fds = new FileDataSource("h:/something.pdf");
    messageBodyPart.setDataHandler(new DataHandler(fds));
    messageBodyPart.setFileName(fds.getName());
    multipart.addBodyPart(messageBodyPart);
    //add multipart to the message
    message.setContent(multipart);
    //send message
    Transport.send(message);

  • Content Type name is not changing on site level

    Hello
    I have one new SP2010 site. I am changing the content type name using following script, but it is not working. I have not used content type in any list or library nor in any existing ite, I am not using content type hub. Can anyone why content name is not
    updating?
    $ParentContentType = $site.RootWeb.AvailableContentTypes["Data control1"]
    if ($ParentContentType -eq $null)
    write-host "not exist"
    else
    $web.$ParentContentType.Name="Data 123Control1"
    $web.AllowUnsafeUpdates = $true;
    $web.Update()
    $web.AllowUnsafeUpdates = $false;

    Make the following change, hope this helps you
    $site.RootWeb.AvailableContentTypes
    to
    $site.RootWeb.ContentTypes
    Ashish Kanoongo, MCP, MCSD, MCTS http://akanoongo.blogspot.in/

Maybe you are looking for

  • SSRS Execution Service Render Method stopped working

    Hello SSRS Profis! I'm having the following Problem: I was trying to integrate SSRS in my Company-Software, and until today it went quite good: Its an ASPMVC 5 project with WCF-Services, and in these i had methods to render reports with the help of t

  • Calling Dynpro components in Webdynpro ABAP.

    Hi friends, Could anyone tell me how to call webdynpro components in DC's in Webdynpro ABAP. Regards Sireesha.

  • Special G/L transaction which only appears on the exceptions list in F110

    Hi All,         While run payment program by F110 for some of the documents are getting not posted due to the error log 017-Special G/L transaction which only appears on the exceptions list. Can anyone tell me to remove the error log and post the sam

  • Error opening KMZ files Photoshop CS3 Extended for Windows

    I just installed PS CS3 Extended and tried to open a Google KMZ file and received the following error: "Could not complete your request because the file format module cannot parse the file" I also tried creating a new document and insert a new layer

  • Re: (forte-users) Anyone used Semaphors in Forte ?

    Jean-Paul, I'm not sure what behaviour you are trying to implement with semaphores. In Forté, the Mutex type is an implementation of a mutual exclusion semaphore. If that's all you need, then using Mutex would be the smartest way to implement a semap