[gmime-devel] Help Need parse Multipart data with help of GMIME




Hi ,
I am try to parse the multipart data (which comes from N/W) on your any url response .
when the response is multipart I wanted to parse this with help of gmime parser and send each part to browser
Main problem ::
how to check data coming is multipart or not
I am doing like this -
      //initialize the gmime
            g_mime_init(0);
            g_mime_charset_map_init();
            g_mime_iconv_init();
      //checking the data coming is multipart or not (void * ptr - response data  )
               GMimeStream* stream = g_mime_stream_mem_new_with_buffer(static_cast<char*>(ptr),dataSize);
               GMimeParser* parser = g_mime_parser_new_with_stream(stream);
               GMimeObject* mimeObject = g_mime_parser_construct_part(parser);
    //checking Gmime Object and and find out content type
                if (mineObject && GMIME_IS_MULTIPART(mimeObject))
                    string m_mainResourceType = g_mime_object_get_content_type_parameter(mimeObject, "type");
----------------------------------------

is it correct the above code .
if yes then still I am facing one problem even though response is multipart(i.e. multipart/mixed) the out of GMIME_IS_MULTIPART(mimeObject) is getting null(i.e. fail ).

so plese suggest me on this ,
I am begginer in useing of gmime parser .

Regards
Vaibhav A. Gurav


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]