Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Binary woes!

    Hi,

    I'm recieving a base64encoded string (png file) from a webservice.

    I'm trying to write the file and output the image. But I'm having problems
    converting the string back to binary - invalid characters come in:

    <cffile action = "write" file = "test.png" output="#toBinary(return)#">

    Outputs the lots of ? characters and fails to write a valid image.

    However if I use:

    <img src="data:image/png;base64,#return# ">

    It outputs the image to screen (in firefox) - So I know the binary encoded
    string has come across fine.

    Can I set the character set for the ToBinary function ?

    I've also tried to change the webservice result to be xsd:base64binary - but
    cfMX throws an error also.

    Any ideas or suggestions please post!

    RossC0.Pico Guest

  2. Similar Questions and Discussions

    1. j2ee woes
      Hi, I recently converted from CFMX7 standalone to j2ee for the practice. Everything installed fine but I'm having problems with CFCs. I can view the...
    2. WSE 2 woes
      I have created the Hello World web service and implemented WSE 2 tokens to validate against a database. I am using VS 2003 and installed the...
    3. PDF woes
      EPS files are intended to be placed on a page in a page-layout program, and thus contain no page orientation or page size information. If you are...
    4. Date Woes
      I am trying to convert a date from this format: yyyymmddHHMMSS.mmmmmmsUUU to a format that ASP.NET (VB.NET) understands. The above date...
    5. 64 bit binary and 32 bit binary have different result. Is it library bug or compiler bug?
      #include <errno.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <dirent.h> #include <assert.h> int main(int argc, char...
  3. #2

    Default Re: Binary woes!


    Sorted - it outputs the binary different to screen than php - but it did encode the file properly - once I allowed it permissions to access the file! doh!
    RossC0.Pico Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139