DataPower

DataPower

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Conversion of application/pdf or text/html to mulitpart/form-data

  • 1.  Conversion of application/pdf or text/html to mulitpart/form-data

    Posted Fri February 07, 2020 01:39 PM
    We have scenario where we are receiving application/pdf or text/html from the consumer and we need to send the data as mulitpart/form-data to backend as backend only accepts data as mulitpart/form-data.

    ------------------------------
    Venkata Omkar Vusirikala
    ------------------------------


  • 2.  RE: Conversion of application/pdf or text/html to mulitpart/form-data

    Posted Wed February 26, 2020 10:04 AM
    There is no builtin support for your use case.
    Since application/pdf is binary, best create a GatewayScript that does read the PDF, and then generate multipart/form-data per spec yourself.

    ------------------------------
    Hermann Stamm-Wilbrandt
    DataPower, XML Compiler developer, L3
    IBM
    Boeblingen
    49-7031-16-3032
    ------------------------------



  • 3.  RE: Conversion of application/pdf or text/html to mulitpart/form-data

    Posted Mon March 02, 2020 03:38 AM
    Thank you Harman,

    I encoded the application.pdf data to base 64, wrapped up the base64 value in an xml and set the MIME headers using xslt and decoded the data, forwarded it to backend to get it working. Now backend is acknoledging the document and were able to process the document as mulipart/form-data.

    Thanks, 
    Omkar.

    ------------------------------
    Venkata Omkar Vusirikala
    ------------------------------