France,

Sure man, no problem. I had the same or at least similar issue. I was having 
trouble getting a PDF content back to the browser properly without it dumping 
raw text to the screen (encrypted text). What I send before is how I got it to 
work properly and I've seen you've done something similar too so glad it's 
working for you. If you have any more trouble let us know.

Ciao!
Javi



Javier Julio
Web Developer, Arc90
www.javier-julio.com

> Subject: Re: Display PDF binary data in a browser without using a tempFile
> From: [EMAIL PROTECTED]
> To: [email protected]
> Date: Thu, 3 Jan 2008 08:35:19 -0500
> 
> Javier,
> 
> Thank you very much for the assistance, your advice worked perfectly!!  Once 
> I was able to get the browser to display the file I realized the upload piece 
> needed some additional modifications (it was inserting incorrectly), but it 
> all works now.
> 
> Thank you!
> France
> 
> For anyone who would like the final code for this example, here it is:
> 
> <!--- uploadForm.cfm --->
> <cfif isDefined('form.submit')>
> 
> <cffile action="READBINARY" file="#form.uploadFile#" variable="binPDF"> 
>       
> <cfquery name="uploadToDatabase" datasource="TestDB">
> INSERT INTO [dbo].[Documents]
> ([documentSource])
> VALUES 
> (<cfqueryparam value="#binPDF#" cfsqltype="CF_SQL_BLOB">)
> </cfquery>    
> 
> <cfelse>
> <form name="uploadForm" action="uploadForm.cfm" method="post" 
> enctype="multipart/form-data">          
> <input type="File" name="uploadFile"> <br><br>
> <input type="Submit" name="submit" value="Upload">    
> </form>
> </cfif> 
> 
> 
> <!--- viewDocument.cfm --->
> <cfquery name="getDocument" datasource="TestDB">
> select top 1 *
> from dbo.Documents
> order by documentId desc
> </cfquery>
> 
> <cfcontent type="application/pdf" reset="no">
> <cfheader name="Content-Disposition" value="attachment; 
> filename=testDocument.pdf">
> <cfoutput>#toString(getDocument.documentSource)#</cfoutput>
> <cfabort>     
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3224
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to