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.document# IS "View"
Error near line 14, column 22.
Error resolving parameter FORM.DOCUMENT
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 name="documents" action="doc_action.cfm?id=#Trim(newdoc.id)#"
method="POST">
<input type="Submit" name="document" value="View">
<input type="Submit" name="document" value="Replace">
<input type="Submit" name="document" value="Detach">
</cfform>
ACTION FILE (doc_action.cfm)
<cfquery name="Get" 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.document# IS "View">
<cfinclude template="view_doc.cfm">
<cfelseif #form.document# IS "Replace">
<cfinclude template="upload2.cfm">
<cfelseif #form.document# 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="Get" 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(get.document)#">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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