Sorry here is the AddFile.cfm page: <html> <head> <title>Append File</title>
<cfparam name="url.Action" type="string" default="list"> <cfswitch expression="#url.Action#"> <cfcase value="Open"> <script language="VBScript"> sub window_onload window.close end sub </script> <cffile action="READBINARY" file="#form.txtFile#" variable="binary_File"> <CFSET string_File=toBase64(binary_File)> <cfset str_FileExtension = right(form.txtFile,3)> <cfquery name="AppendFile" datasource="PurchaseTracking" dbtype="ODBC"> DECLARE @@ptrval varbinary(16) INSERT into Attachments (PONumber,Attachment,AttachmentType,FileExtention,AttachmentDate,Reference) VALUES ('#url.PONumber#',' ',#form.txtType#,'#str_FileExtension#','#form.txtAttachmentDate#','#form.txt Reference#') SELECT @@ptrval = TEXTPTR(Attachment) FROM Attachments WHERE PONumber = '#url.PONumber#' WRITETEXT Attachments.Attachment @@ptrval '#string_File#' </cfquery> </cfcase> </cfswitch> <script language="VBScript"> sub Cancel window.close() end sub </script> </head> <body> <cfswitch expression="#url.Action#"> <cfcase value="list"> <form action="Addfile.cfm?Action=Open&PONumber=<cfoutput>#url.PONumber#</cfoutput> " method="post"> <table border="1"> <tr> <td>Attachment Date</td> <td><input type="text" name="txtAttachmentDate"></td> </tr> <tr> <td>Type</td> <td> <select name="txtType"> <cfoutput query="Type_get"> <option value="#ID#">#Description#</option> </cfoutput> </select> </td> </tr> <tr> <td>Reference</td> <td><input type="text" name="txtReference"></td> </tr> <tr> <td>Attachment</td> <td><input type="file" name="txtFile"></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" value="Save"> <input type="button" value="Cancel" onClick="Cancel"> </td> </tr> </table> </form> </cfcase> <cfcase value="Open"> </cfcase> </cfswitch> </body> </html> -----Original Message----- From: CAROSATI Gerald [SMTP:[EMAIL PROTECTED]] Sent: 30 September 2002 17:59 To: CF-Talk Subject: RE: CFFILE PDF to Sybase? Hi there ... Here is an exemple using sql server ... Save page: <<AddFile.cfm>> Viewer Page: <<Viewer.cfm>> for the save page, I pass a URL variable (ponumber) which contains the ID of the record to save The SQL syntax will obviously have to be modified since I did it for SQL server ... for the viewer the trick is to use cfheader tag in order to force the browser to open the page with the associated reader ... Hope it helps ... Gerald Carosati -----Original Message----- From: Cathy Taylor [SMTP:[EMAIL PROTECTED]] Sent: 25 September 2002 20:40 To: CF-Talk Subject: CFFILE PDF to Sybase? Hi all! I've been a semi-lurker for a while and try to read all the threads, but admittedly don't. So I apologize if this has been gone over and over before. We'd like to give our users the ability to upload a PDF file (as well as text files) directly into Sybase. We're running CF 5 on Solaris. Currently, the way we have it configured is to make the users upload a zip file with their text files and pdf. Then cfexecute unzips the file and bcps the text data into the database. We just don't know what to do with the PDF file. Any suggestions? I can't let the developers leave it on my production server (while I am a certified developer, I'm actually the system administrator) and it really should go into the database. Of course, then we need a way to retrieve it from the database to display should a user want to pull it up. On a completely different topic, has anyone switched from CFStudio to Dreamweaver? We obviously will need to at some point, but just realized that we can't use our PVCS (version control) client with Dreamweaver (and it works just fine with CF Studio). Just wondering if anyone else has run into that. Thanks! Cathy ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists