Highlighted

Rerun the page if saved "file-size" = zero

Contributor ,
Aug 20, 2015

Copy link to clipboard

Copied

I have the following saved page setup as a "Scheduled Task" in CF9.

- Occasional the connection fails and the "AC_ACCT.csv" file-size is saved as a 0k file

- How would I alter this page to do a check on that csv file, and rerun the page until it is no longer 0k?

In summary, run the page, check the saved csv file, if >0k then end, if =0k then rerun the page again.

2015-08-20_1501.png

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>MBS Web Service Call</title>

</head>

<!--- Create a variable for the URL --->

<cfset theURL = "https://domain.com.php">

<!--- Make the Post Request --->

<cfhttp

        method="post"

        url="#theURL#"

        port="443"

        throwonerror="True"

        resolveurl="yes"

      delimiter=","

      textqualifier=""

        path="C:\MBS"

        file="AC_ACCT.csv">

<cfhttpparam type="formfield" name="webServiceKey" value="xxxxxxxxxxxxxx">

<cfhttpparam type="formfield" name="companyId" value="101">

<cfhttpparam type="formfield" name="queryTableName" value="AC_ACCT">

</cfhttp>

<!--- Dump the Data to File --->

<body>

</body>

</html>

Views

113

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Rerun the page if saved "file-size" = zero

Contributor ,
Aug 20, 2015

Copy link to clipboard

Copied

I have the following saved page setup as a "Scheduled Task" in CF9.

- Occasional the connection fails and the "AC_ACCT.csv" file-size is saved as a 0k file

- How would I alter this page to do a check on that csv file, and rerun the page until it is no longer 0k?

In summary, run the page, check the saved csv file, if >0k then end, if =0k then rerun the page again.

2015-08-20_1501.png

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>MBS Web Service Call</title>

</head>

<!--- Create a variable for the URL --->

<cfset theURL = "https://domain.com.php">

<!--- Make the Post Request --->

<cfhttp

        method="post"

        url="#theURL#"

        port="443"

        throwonerror="True"

        resolveurl="yes"

      delimiter=","

      textqualifier=""

        path="C:\MBS"

        file="AC_ACCT.csv">

<cfhttpparam type="formfield" name="webServiceKey" value="xxxxxxxxxxxxxx">

<cfhttpparam type="formfield" name="companyId" value="101">

<cfhttpparam type="formfield" name="queryTableName" value="AC_ACCT">

</cfhttp>

<!--- Dump the Data to File --->

<body>

</body>

</html>

Views

114

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 20, 2015 0

Have something to add?

Join the conversation