I am running CF4.5 and I use the following code to do the posting of an xml
file:

<CFHTTP URL="http://www.mydomain.com/grabfile.cfm" METHOD="POST" TIMEOUT="10"
throwonerror="Yes">
    <CFHTTPPARAM NAME="myfile" TYPE="file" FILE="c:\a_file.xml">
</CFHTTP>

<CFOUTPUT>
The file content:<br>
#cfhttp.filecontent#<BR>
<BR>
<H3><B>The mime-type:</B></H3><BR>
#cfhttp.mimetype#<BR>
<!--- <H3><B>The Status Code:</B></H3><BR>
#cfhttp.statuscode#<BR>
<H3><B>The Raw Header:</B></H3><BR>
#cfhttp.header#<BR> --->
</CFOUTPUT>

<H3><B>Output the Response Headers:</B></H3><BR>
<HR>
<CFLOOP collection=#CFHTTP.RESPONSEHEADER# item="httpHeader">
    <CFSET value = CFHTTP.RESPONSEHEADER[httpHeader]>
    <CFIF IsSimpleValue(value)>
        <CFOUTPUT>
            #httpHeader# : #value#<BR>
        </CFOUTPUT>
    <CFELSE>
        <CFLOOP index="counter" from=1 to=#ArrayLen(value)#>
            <CFOUTPUT>
                #httpHeader# : #value[counter]#<BR>
            </CFOUTPUT>
        </CFLOOP>
    </CFIF>
</CFLOOP>

If you are interested in sending a stream instead of a file then replace the
cfhttpparam tag in line 2 with this:
<cfhttpparam name="XMLField" type="FORMFIELD" value="#xmlStream#">

HTH,
tom



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with 
'unsubscribe' in the body or visit the list page at www.houseoffusion.com

Reply via email to