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:3223
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