Dennis,
That was actually a bad paste of the code. I will re-paste it here. This
works. I believe my original problem was that I had the form field of
name="document" which I think is a reserved word. I changed it to doc
and it appears to be working now, at least locally. I still need to test
in production environment.
James
-------------------------------------
FORM FILE
-------------------------------------
<cfoutput><strong>Response Document:</strong>
#newdoc.document#</cfoutput>
<cfif #newdoc.document# IS NOT "">
<cfform action="doc_action.cfm?id=#Trim(newdoc.id)#" method="POST">
<input type="Submit" name="doc" value="View"> <input type="Submit"
name="doc" value="Replace"> <input type="Submit" name="doc"
value="Detach">
</cfform>
<cfelse>
<cfform action="upload.cfm?lid=#lid#" method="POST">
<input type="Submit" value=" Attach ">
</cfform>
</cfif>
--------------------------------------
ACTION FILE
--------------------------------------
<cfif form.doc IS "View">
<cfinclude template="view_doc.cfm">
<cfelseif form.doc IS "Replace">
<cfinclude template="upload2.cfm">
<cfelseif form.doc IS "Detach">
<cfquery name="Delete_Doc" datasource="lsarprod">
delete from lsardba.tbl_response
where id = '#url.id#'
</cfquery>
<font face="Arial" size="2"><strong>Document
<cfoutput>#Trim(get.document)#</cfoutput> for Case number
<cfoutput>#Trim(get.id)#</cfoutput> has been removed.</strong></font>
<br>
<br>
<font face="Arial" size="2">
<cfoutput>
<a
href="response.cfm?lid=#Trim(get.id)#&user=#UrlEncodedFormat(Trim(submissions.username))#"><strong>Return</strong></a>
</cfoutput>
</font>
</cfif>
---------------------------------------------
VIEW_DOC.CFM
---------------------------------------------
<cfquery name="GetView" datasource="lsarprod">
select * from lsardba.tbl_response
where id = '#url.id#'
</cfquery>
<cfcontent type="application/msword"
file="C:\Inetpub\wwwroot\Intranet-Secure\lsar_db2\responses\#Trim(getview.document)#">
Dennis Powers wrote:
>
> James,
>
> On the form page you named the submit button "docu" on the action page you
> are referencing "doc". It should be "form.docu"
>
> Best Regards,
>
> Dennis Powers
> UXB Internet
> (203) 879-2844
> http://www.uxbinfo.com/
>
> -----Original Message-----
> From: James Taavon [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 27, 2001 9:44 AM
> To: CF-Talk
> Subject: Repost: CFCONTENT Strikes Again...Viewing a file
>
> Reposting due to Mail hickup...If anyone responded to this, I never got
> it.
>
> I have a three button form that gives a user the option to view, replace
> or delete a file. The latter two work just fine, but viewing the file is
> giving me an error and I am not sure why. It opens MSWORD and displays
> an error that it can't resolve the form variable. All the code looks
> right, but I am not I am not perfect. Any input would be appreciated.
>
> Thanks in advance.
>
> Error Occurred While Processing Request
> Error Diagnostic Information
>
> An error occurred while evaluating the expression:
>
> form.doc IS "View"
>
> Error near line 14, column 22.
>
> Error resolving parameter FORM.DOC
>
> The specified form field cannot be found. This problem is very likely
> due to the fact that you have misspelled the form field name.
>
> The error occurred while processing an element with a general identifier
> of (CFIF), occupying document position (14:1) to (14:32).
>
> Date/Time: 06/14/2001 09:27:09 AM
> Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Hotbar 2.0)
> Remote Address: 127.0.0.1
> Query String: id=10000
>
> FORM FILE (response2.cfm)
>
> <cfform action="doc_action.cfm?id=#Trim(newdoc.id)#"
> method="POST">
> <input type="Submit" name="docu" value="View">
> <input type="Submit" name="docu" value="Replace">
> <input type="Submit" name="docu" value="Detach">
> </cfform>
>
> ACTION FILE (doc_action.cfm)
>
> <cfquery name="GetDoc" datasource="lsarprod">
> select * from lsardba.tbl_response
> where id = '#url.id#'
> </cfquery>
>
> <cfquery name="Submissions" datasource="lsarprod">
> select * from lsardba.tbl_cases, lsardba.tbl_users
> where lsardba.tbl_users.fullname = lsardba.tbl_cases.assigned and
> lid = '#url.id#'
> </cfquery>
>
> <cfif form.doc IS "View">
> <cfinclude template="view_doc.cfm">
> <cfelseif form.doc IS "Replace">
> <cfinclude template="upload2.cfm">
> <cfelseif form.doc IS "Detach">
> <cfquery name="Delete_Doc" datasource="lsarprod">
> delete from lsardba.tbl_response
> where id = '#url.id#'
> </cfquery>
> <font face="Arial" size="2"><strong>Document
> <cfoutput>#Trim(get.document)#</cfoutput> for Case number
> <cfoutput>#Trim(get.id)#</cfoutput> has been removed.</strong></font>
> <br>
> <br>
>
> <font face="Arial" size="2">
> <cfoutput>
> <a
> href="response.cfm?lid=#Trim(get.id)#&user=#UrlEncodedFormat(Trim(submission
> s.username))#"><strong>Return</strong></a>
> </cfoutput>
> </font>
> </cfif>
>
> VIEW_DOC.CFM
>
> <cfquery name="GetView" datasource="lsarprod">
> select * from lsardba.tbl_response
> where id = '#url.id#'
> </cfquery>
>
> <cfcontent type="application/msword"
> file="C:\Inetpub\wwwroot\Intranet-Secure\lsar_db2\responses\#Trim(getview.do
> cument)#">
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists