Archived Forum Post

Index of archived forum posts

Question:

What is the correct procedure for extracting a Zip file from my MIME?

Apr 13 '17 at 09:25

I have a response and in the response is a MIME with a binary Zip file attachment. I have signed up for the 30 day trial and if this works out I would love to purchase this. I am using MS Access VBA.Thanks.

    ChilkatLog:
  LoadMimeFile:
    DllDate: Mar 20 2017
    ChilkatVersion: 9.5.0.66
    UnlockPrefix: Anything for 30-day trial.
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    path: --MIMEBoundaryurn_uuid_7E229B3F5C86A212B51492052835776140997
Content-Type: application/xop+xml; charset=utf-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:7E229B3F5C86A212B51492052835776140998>

<downloadfileresponse xmlns="http://www.ebay.com/marketplace/services"><ack>Success</ack><version>1.1.0</version><timestamp>2017-04-13T03:07:15.776Z</timestamp><fileattachment><size>1653</size><data><xop:include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:urn:uuid:C0CA465CC98C26B35D1492052946315"/></data></fileattachment></downloadfileresponse>
--MIMEBoundaryurn_uuid_7E229B3F5C86A212B51492052835776140997
Content-Type: application/x-gzip
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:c0ca465cc98c26b35d1492052946315>

???AFPIBulkTest1.xml?Y_o?G?}@ A?m?u?n ??R??,|z??qZH??>?}N???4?????H2.f???uZ/»w?^PC??93????    ???(?}J?\????j?R
F????ek?_???^Q?Í???^Q*1??e>???)y?E?/Ig???*???O?4?????*?R4?3?,Dh?Vm\qC?H_|#?}???b?IO#??Cz1??L?jq:R|i???k???????y?m/SH???(*???D ??')??????A?3??%???4|?,?Z???"?c?V3??????0??'c?tt??:^??Qb????  ?b?uA??:??l?????>???;?? Cj@q74?xt?????a?G~?>?Pe}?6?#? c???8n?i???B????bw?n?????x?(?????]?[???tN?l????*?E???}?e[?v?????W,4*???+??x?F??Ly??R0n'?H6?????X^v ?Rx?AE??C???Cz^???q???h??/GH?"?g???j)s\????_|?qv*?????(1s ??    L?? ??? ?C??M?"%213i? ?]???h??)??8???YL??&???=??R?????B??#???<?????f?\?h?0?I????????????I?@???I.O??T????ZK????f???}??@5^??Zp???-??"??[_?y??i???s??m???:eS??|???fT?W????G7{?b??-????V??G*?!r?N?????*En?Y?}9?%b????o.?Dt?~?3????7?nk?b"??-??x???
a??ye????7
--MIMEBoundaryurn_uuid_7E229B3F5C86A212B51492052835776140997--
    loadFileX:
      Failed to open file (3)
      utf8Filename: \\?\C:\Users\Station\Documents\--MIMEBoundaryurn_uuid_7E229B3F5C86A212B51492052835776140997Content-Type_ application\xop+xml; charset=utf-8; type=_text\xml_Content-Transfer-Encoding_ binaryContent-ID_ _0.urn_uuid_7E229B3F5C86A212B51492052835776140998___xml version='1.0' encoding='UTF-8'___downloadFileResponse xmlns=_http_\www.ebay.com\marketplace\services___ack_Success_\ack__version_1.1.0_\version__timestamp_2017-04-13T03_07_15.776Z_\timestamp__fileAttachment__Size_1653_\Size__Data__xop_Include xmlns_xop=_http_\www.w3.org\2004\08\xop\include_ href=_cid_urn_uuid_C0CA465CC98C26B35D1492052946315_\__\Data__\fileAttachment__\downloadFileResponse_--MIMEBoundaryurn_uuid_7E229B3F5C86A212B51492052835776140997Content-Type_ application\x-gzipContent-Transfer-Encoding_ binaryContent-ID_ _urn_uuid_C0CA465CC98C26B35D1492052946315_???AFPIBulkTest1.xml?Y_o?G?}@ A?m?u?n ??R??,_z??qZH??_?}N???4?????H2.f???uZ\»w?^PC??93????    ???(?}J?\_???j?RF????ek?_???^Q?Í???^Q_1??e_???)y?E?\Ig
???_???O?4?????_?R4?3?,Dh?Vm\qC?H__#?}???b?IO#??Cz1??L?jq_R_i???k???????y?m\SH???(_???D ??')??????A?3??%???4_?,?Z???_?c?V3??????0??'c?t_?v_t??_^??Qb???? ?b?uA??_??l?????_???;?? Cj@q74?xt?????a?G~?_?Pe}?6?#? c?_?8n?i???B????bw?n?????x?(?????]?[???tN?l????_?E???}?e[?v?????W,4_???+??x?F??Ly??R0n'?H6?????X^v ?Rx?AE??C???Cz^???q???h??\GH?_?g???j)s\??_??X???J9?!?Z???;??pM????5???9?_??`pn?????????????R???n?b?5??c?If??$2??zx?r??3a??4?A????C5??_XV??D??!_?,?S?bgP{I??yd?~???q??K???????K?n?;?o??ab??_?N????????LA?0???,_??_W7????&????]??N????I???!b$c^   ?\???-??4+??e??_?E+??pW?7???L??^Z`{I_?_??__?qv_?????(1s ?? L?? ??? ?C??M?_%213i? ?]???h??)??8???YL??&???=??R?????B??#???_?????f?\?h?0?I????????????I?@???I.O??T????ZK????f???}??@5^??Zp???-??_??[_?y??i???s??m???_eS??_???fT?W????G7{?b??-????V??G_?!r?N?????_En?Y?}9?%b????o.?Dt?~?3????7?nk?b_??-??x???a??ye????7--MIMEBoundaryurn_uuid_7E229B3F5C86A212B5149205283
5776140997--
      osErrorInfo: The system cannot find the path specified.
      localWindowsFilePath: --MIMEBoundaryurn_uuid_7E229B3F5C86A212B51492052835776140997Content-Type_ application\xop+xml; charset=utf-8; type=_text\xml_Content-Transfer-Encoding_ binaryContent-ID_ _0.urn_uuid_7E229B3F5C86A212B51492052835776140998___xml version='1.0' encoding='UTF-8'___downloadFileResponse xmlns=_http_\\www.ebay.com\marketplace\services___ack_Success_\ack__version_1.1.0_\version__timestamp_2017-04-13T03_07_15.776Z_\timestamp__fileAttachment__Size_1653_\Size__Data__xop_Include xmlns_xop=_http_\\www.w3.org\2004\08\xop\include_ href=_cid_urn_uuid_C0CA465CC98C26B35D1492052946315_\__\Data__\fileAttachment__\downloadFileResponse_--MIMEBoundaryurn_uuid_7E229B3F5C86A212B51492052835776140997Content-Type_ application\x-gzipContent-Transfer-Encoding_ binaryContent-ID_ _urn_uuid_C0CA465CC98C26B35D1492052946315_???AFPIBulkTest1.xml?Y_o?G?}@ A?m?u?n ??R??,_z??qZH??_?}N???4?????H2.f???uZ\»w?^PC??93???? ???(?}J?\_???j?RF????ek?_???^Q?Í???^Q_1??e_???)y?E?\Ig???_???O?4?????_?R4?3?,Dh?Vm\q
C?H__#?}???b?IO#??Cz1??L?jq_R_i???k???????y?m\SH???(_???D ??')??????A?3??%???4_?,?Z???_?c?V3??????0??'c?t_?v_t??_^??Qb???? ?b?uA??_??l?????_???;?? Cj@q74?xt?????a?G~?_?Pe}?6?#? c?_?8n?i???B????bw?n?????x?(?????]?[???tN?l????_?E???}?e[?v?????W,4_???+??x?F??Ly??R0n'?H6?????X^v ?Rx?AE??C???Cz^???q???h??\GH?_?g???j)s\??_??X???J9?!?Z???;??pM????5???9?_??`pn?????????????R???n?b?5??c?If??$2??zx?r??3a??4?A????C5??_XV??D??!_?,?S?bgP{I??yd?~???q??K???????K?n?;?o??ab??_?N????????LA?0???,_??_W7????&????]??N????I???!b$c^   ?\???-??4+??e??_?E+??pW?7???L??^Z`{I_?_??__?qv_?????(1s ?? L?? ??? ?C??M?_%213i? ?]???h??)??8???YL??&???=??R?????B??#???_?????f?\?h?0?I????????????I?@???I.O??T????ZK????f???}??@5^??Zp???-??_??[_?y??i???s??m???_eS??_???fT?W????G7{?b??-????V??G_?!r?N?????_En?Y?}9?%b????o.?Dt?~?3????7?nk?b_??-??x???a??ye????7--MIMEBoundaryurn_uuid_7E229B3F5C86A212B51492052835776140997--
      Failed to open for read.
    --loadFileX
    Failed.
  --LoadMimeFile
--ChilkatLog

Answer

The LoadMimeFile expects a file path to be passed to it (but you're passing the actual MIME string to it).

You should instead call LoadMime.

However.. it seems you have binary MIME, so you CANNOT put binary bytes in a string. See http://cknotes.com/never-try-to-handle-binary-data-as-a-string/

For binary MIME, you'll need to call LoadMimeBytes, or LoadMimeBd (assuming the binary MIME was previously loaded into a BinData object).