I'm assuming that you are getting this information via CFHTTP? Yes?

If so, you can use a couple of attributes in the CFHTTP tag to write the
file automatically to your HD...

<cfhttp url="http://usps.gov/yourpdf.pdf";
   method="GET"
   port="80"
   resolveurl="false"
   path="D:\intepub\wwwroot\"
   file="newpdf.pdf">

This will properly write the pdf locally.  No translation needed.  I got
goofed when you said it's a binary base64 attachment?  If it's just a binary
document, this should work.  Let me know if this is not the case.  If it is
truly a base64 string from the USPS, then use the toBinary and CFFILE to
write it.  

HTH,

Jeff Garza
Lead Developer/Webmaster
Spectrum Astro, Inc.
480.892.8200
[EMAIL PROTECTED]
http://www.spectrumastro.com



-----Original Message-----
From: Steven Salter [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 20, 2002 2:41 PM
To: CF-Talk
Subject: RE: Cold Fusion code to decode binary base64 attachment


>Try the toBase64(binaryvar) function built in to CF...  You should then be
>able to output the XML file as a string.
>
>Jeff Garza

Thanks Jeff,

hmmm, that definitely changed the binary content into something else. I
tried to save it as a pdf with cffile but it still looks like a string of
characters. :)

I suppose I should be more specific. My steps:

1) receive binary from usps as a result (this works)
2) extract binary string from result, let's call the variable 'binvar'
3) <cfset myvar = #tobase64(binvar)#>
4) display #myvar# or write it to a file as a PDF.

am I on the right track? Sorry I am being so dense this afternoon, getting
late for me.

Thanks,
Steve




______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to