<cfhttp          url = "hostname"          port = "port_number"          method = "get_or_post"          username = "username"          password = "password"          name = "queryname"          columns = "query_columns"          firstrowasheaders = "yes" or "no"          path = "path"          file = "filename"          delimiter = "character"          textQualifier = "character"          resolveURL = "yes" or "no"          proxyServer = "hostname"          proxyPort = "port_number"          userAgent = "user_agent"          throwOnError = "yes" or "no"          redirect = "yes" or "no"          timeout = "timeout_period">  </cfhttp> 


Executes HTTP POST and GET operations on files. You can execute standard GET operations and create a query object from a text file. POST operations upload MIME file types to a server, or post cookie, formfield, URL, file, or CGI variables directly to a server.


url (Required)

Default: http. Absolute URL of a host name or IP address of the server on which the file resides. The URL must include protocol (http or https) and the host name and can contain a port number.

port (Optional)

Default: 80. Port number on the server from which object is requested. Can be overridden by specifying a port in the url attribute.

method (Required)

Default: get

  • get. Downloads text or binary file or to create a query from the contents of a text file.

  • post. Sends information to a server and requires a cfhttpparam tag.

username (Optional)

Username for authentication when required.

password (Optional)

Password for authentication when required. .

name (Optional)

Name to give a query if it is created from a file.

columns (Optional)

When using the GET function, this enables the creation of column names. The default uses the first row of the file as the column name; if this is not desired, this attribute overwrites this functionality, but ColdFusion will never use the first row of the file as data.

firstrowasheaders (Optional)

Default: Yes

  • Yes. If the columns attribute is not specified, then the first row is used as column heads. If the columns attribute is specified then this attribute is ignored

  • No. If the columns attribute is not specified, then it processes the first row as data and creates its own column names, such as "column_1".If the columns attribute is specified, then this attribute is ignored.

path (Optional)

Path to directory in which to store the file. If path is not specified in POST or GET, a variable (cfhttp.fileContent) is created.

file (Required if post and if path is specified)

Name of the file that is accessed. For GET operations, defaults to name specified in the URL.

delimiter (Required to create query)

Default: , (comma). Options are tab or comma.

textQualifier (Required to create query)

Default: "" (double quotation mark)

This shows the start and finish of a column.

resolveURL (Optional)

Default: No. For GET and POST.

Yes: So that links remain valid, this resolves internal URLs, including port number in a page reference returned into fileContent. The following HTML tags are resolved: img src, a href, form action, applet code, script src, embed src, embed pluginspace, body background, frame src, bgsound src, object data, object classid, object codebase, and object usemap.

proxyServer (Optional)

Host name or IP address of a proxy server.

proxyPort (Optional)

Default: 80, which is the port number on proxy server from which the object is requested.

userAgent (Optional)

User agent request header.

throwOnError (Optional)

Default: No. If Yes, throws an exception that can be caught with the CFTRY and CFCATCH tags.

redirect (Optional)

Default: Yes. Enables up to four redirects and can be followed by accessing the variable cfhttp.responseHeader[LOCATION].

  • Yes. Redirect execution.

  • No. Stop execution.

timeout (Optional)

This setting overrides the timeout setting in the ColdFusion Administrator, but ColdFusion will always make sure that the timeout will occur at the same time as the page timeout.

Inside ColdFusion MX
Inside Coldfusion MX
ISBN: 0735713049
EAN: 2147483647
Year: 2005
Pages: 579 © 2008-2017.
If you may any questions please contact us: