I am trying to save a PDF file (which I am being passed from a adobe pdf submit service as I think a binary stream) in a browser, I just want the PDF to saved so I can attach it and email it. What CFM should I use to retrieve the submitted pdf content in a binary and retain a valid pdf file ?- I found the below code here as one answer but it is not doing binary stuff. The problem I am having is that the pdf that I reconstruct is .close. looking but not valid; I think I see it is losing carriage returns or something it is not good please point me an the correct binary in statements...
I think I need to do what this person did but with CFM
http://www.experts-exchange.com/Web/WebDevSoftware/Q_21102554.html<cfscript>
pc = GetPageContext();
req = pc.getRequest();
readerObj = req.getReader();
output = '';
line = readerObj.readLine();
while (isDefined("line")) {
output = output & line;
line = readerObj.readLine();
}
readerObj.close();
</cfscript>
<cfoutput>#output#
</cfoutput>
I also tried this but the content was empty?.....content [empty string]
<cfset x = GetHttpRequestData()>
<cfoutput><hr><cfdump var="#x#"><br></cfoutput>
struct
content [empty string]
headers struct
ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpo
int, application/x-shockwave-fl
ash, application/msword, application/vnd.ms-excel, */*
ACCEPT-ENCODING gzip, deflate
ACCEPT-LANGUAGE en-us
CACHE-CONTROL no-cache
CONNECTION Keep-Alive
CONTENT-LENGTH 158289
CONTENT-TYPE application/pdf
COOKIE CFID=129137; CFTOKEN=45168361; SC_ID=; TOMANYATTEMPTMSG=
USER-AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
method POST
protocol HTTP/1.1
Start Free Trial