Skip to main content
Participating Frequently
January 3, 2021
Answered

How do I convert this?

  • January 3, 2021
  • 1 reply
  • 453 views

I am trying to use the Google QR code generator and I cannot read the response. If you go here: https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=123456 it will produce a PNG image of a QR code with 123456 in its message. 

 

When I try to read the filecontent of a cfhttp response I get this:

 

‰PNG  IHDR±±KË’bKGDÿÿÿ ½§“ÒIDATxœíÝAnÛ0@Áºèý¯œ.² ž7*ÃOËéÌ>²<fd’����_ðÅïWß·£ J”&(MPš 4Ai‚Ò¥ J”&(MPš 4Ai‚Ò¥ J”&(MPš 4Ai‚ú³ñZ�ÇcãÕþÕ•ÅKÏwøüWWžbí¯æì]¸eœ 4Ai‚Ò¥ jç¼ãÙÜFW¾çïš ¬=ÅkŸý;Œ”&(MPš 4AÍÎ;ž­}g>¹Û•wk÷sÿgÿdœ 4Ai‚Ò¥ êô¼ã¤µ_Cíše¼/㥠J”&(MP?yÞ±6ƒ˜{ßñ.Œ”&(MPš 4A�žwÜÿûÜê‰û?û'㥠J”&(MP³óŽ×îòtÅ®®®\ù]'(MPš 4Ai‚z¼Ë?áxs±Æ8Ai‚Ò¥ JÔéó;v­ž˜;eãµ{UÍÝáuÆ J”&(MPš NŸß±k�öÜÜd—“ÏåÜ@fi‚Ò¥ JÔÎyÇÜʈ]Wž{—±ëÊwØMË8Ai‚Ò¥ JÔìúŽ]3ˆ]oÞåä¾×2NPš 4Ai‚Ò5»¾c×7ÿµÏºbnFóÚ•,ßaœ 4Ai‚Ò¥ êÿÚÏêäê‰÷}·bœ 4Ai‚Ò¥ êô~VsN¾;˜; ý+>Œ”&(MPš 4A�ÞÏj—¹ÄÜìi×=[WÎiš 4Ai‚Ò5;ïxv·_�\…±öék×ù㥠J”&(MP§ç'�Ü�öä�iÆ J”&(MPš ~ò¼cמ½s+Íï9[1NPš 4Ai‚ÒuzÞqr¿¦¹½vOž$¸ëÊ×'(MPš 4Ai‚š�wÜíwD'Ï1\»Ÿ¹ÏºÎ8Ai‚Ò¥ JÔO>¿ƒ5Æ J”&(MPš 4Ai‚Ò¥ J”&(MPš 4Ai‚Ò¥ J”&(MPš 4Ai‚Ò¥ ê/ëÞp̰/IEND®B`‚

 

What do I do with this? I have tried writing to a file with a PNG extension but the file displays nothing. Is there a conversion I need to make?

    This topic has been closed for replies.
    Correct answer Dave Watts

    CFHTTP has a getAsBinary attribute. Set this to "yes". Then, you should be able to use CFFILE to write it to disk. Note that even the smallest binary file will be much larger than the snippet of stuff you show in your post.

     

    Dave Watts, Eidolon LLC

    1 reply

    Dave WattsCommunity ExpertCorrect answer
    Community Expert
    January 3, 2021

    CFHTTP has a getAsBinary attribute. Set this to "yes". Then, you should be able to use CFFILE to write it to disk. Note that even the smallest binary file will be much larger than the snippet of stuff you show in your post.

     

    Dave Watts, Eidolon LLC

    Dave Watts, Eidolon LLC
    PaulBWAuthor
    Participating Frequently
    January 3, 2021

    Dave Watts,

     

    Thank you very much for your time. As you know... this did solve my issue.

     

    Paul