Thread: DIME Attachments

  1. #1
    Registered User
    Join Date
    Apr 2013
    Location
    Evansville, Indiana, United States
    Posts
    2

    DIME Attachments

    I am trying to send a DIME Attachment as a HTTP POST using the libcurl. I using this to communicate with a SOAP API. All my other function work properly but I find the correct way to send a file as a DIME attachment.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Direct Internet Message Encapsulation - Wikipedia, the free encyclopedia
    Which basically says it's 10 year old dead technology originally supported by only one manufacturer, and never had an RFC.

    So it's no surprise that curl doesn't support it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2013
    Location
    Evansville, Indiana, United States
    Posts
    2
    It would appear that Amazon Web Services is still using it for their SOAP API (see PutObject - Amazon Simple Storage Service)

    PutObject


    The PutObject operation adds an object to a bucket. The data for the object is attached as a DIME attachment.
    To ensure an object is not corrupted over the network, you can calculate the MD5 of an object, PUT it to Amazon S3, and compare the returned Etag to the calculated MD5 value.
    If an object already exists in a bucket, the new object will overwrite it because Amazon S3 stores the last write request. However, Amazon S3 is a distributed system. If Amazon S3receives multiple write requests for the same object nearly simultaneously, all of the objects might be stored, even though only one wins in the end. Amazon S3 does not provide object locking; if you need this, make sure to build it into your application layer.
    Is there any other library that might support this?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    It would be worth asking Amazon then, what their supported toolkits and frameworks are.

    I imagine all sorts of people are using this, and don't give a monkey's that DIME is working underneath whatever abstraction they're using.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    You can do the DIME encapsulation yourself, and just hand it off as a prepackaged tur.. chunk to libcurl.

    In other words, it boils down to first generating the binary DIME data. Then, set the CURLOPT_POSTFIELDSIZE option to the number of bytes. Write a helper function to provide the DIME data, and tell libcurl about it by setting the CURLOPT_READFUNCTION option. See CURLOPT_POST for more details and explanations. Simply put, your helper function will provide all the POST data, containing the binary DIME attachment only, and that's it; you must not set any CURLOPTS_POSTFIELDS (except to NULL).

    As to generating the DIME binary data chunk itself, the last IETF draft should contain all you need, but I personally would not bother. Sooner or later you'll have to switch to standard formats anyway.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. a dime off.
    By rosemary in forum C Programming
    Replies: 19
    Last Post: 10-22-2012, 11:23 PM
  2. Attachments
    By Dark_Phoenix in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-04-2006, 11:09 PM
  3. attachments
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 03-22-2002, 04:49 PM
  4. Opening Attachments
    By Witch_King in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2001, 08:19 AM