Auto download from cj ftp to feed directory
Hi David,
Since the cj used for Referral Period would help me to give a directions for auto download into cj ftp?
Revision : 12/10B
Rgds,
Hi David,
Based on http://www.pricetapestry.com/node/76
I tested with clixGalore worked fine. tested for CJ but never succeed. ERROR - TRANSFER FAILED. both tested with unzip: yes and no
Regards
Hi Martin,
The first thing I would suggest is to take the FTP URL that you constructed for your CJ feed and paste it into the address bar of your web browser. That will double check that everything is correctly formatted and your browser should begin to download the file if so.
If that's all fine, the next thing I would suggest is to try curl as the automation handler. In your config.advanced.php change line 43 as follows:
$config_automationHandler = "curl";Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Hi David,
I tested on browser, it worked fine,... i can download the file.
tested on automation tool : ERROR - TRANSFER FAILED
I changed line 43 :
from $config_automationHandler = "php"; into
$config_automationHandler = "curl";
and tested automation tool again.
But I ve got the same msg : ERROR - TRANSFER FAILED
Rgds,
Hi Martin,
Here's how to obtain detailed error information from CURL which should help resolve the problem. In includes/automation.php, look for the following code at line 127:
$retval = curl_exec($ch);...and REPLACE with:
$retval = curl_exec($ch);
if (!$retval)
{
global $curlError;
$curlError = curl_error($ch);
}Finally, look for the following code at line 48:
$status = "ERROR - TRANSFER FAILED";...and REPLACE with:
$status = "ERROR - TRANSFER FAILED";
global $curlError;
$status .= " ".$curlError;If you could let me know the additional error message reported that should help diagnose the problem...
Thanks,
David.
--
PriceTapestry.com
Hi David,
I changed automation.php as above. than running again automation tool
ftp://CJ_id:CJ_password@datatransfer.cj.com/outgoing/productcatalog/path/CJ_files_Catalog.txt.gz
Status : ERROR - TRANSFER FAILED
no additional error message
Rgds,
Hi Martin,
I'm sorry it's proving awkward, I'll follow up by email...
Cheers,
David.
--
PriceTapestry.com
Hi David,
I have the same problem with CJ. Could make the solution public as soon as solved?
Thanks,
Daniel
Hi Daniel,
Thanks for your post (apologies for the delay appearing, I moderate all posts before publication) - Martin posted the working CJ link in the Affiliate Network Product Feed URLs thread here. The solution is to change the transport method in your CJ account to HTTP, and use URLs of the following format:
http://[Username]:[Password]@datatransfer.cj.com/datatransfer/files/[Username]/outgoing/productcatalog/[MerchantID]/Merchant_Name_Product_Catalog.txt.gzCheers,
David.
--
PriceTapestry.com
Hi David,
I am having the same issue. I first tried with the feed hosted on my server, but got the same error as above. So I tried your suggestion of loading it from CJ's servers, but am still getting the same error message.
I can confirm that the URL is formatted correctly and I can download the feed manually through my browser.
Any help would be appreciated.
Thanks,
Marc.
Hello Marc, and welcome to the forum!
Just as you posted your comment I posted the above reply to another user regarding using the HTTP method (rather than FTP) to access CJ feeds.
If you've already tried that; please could you confirm the status of the Automation Handlers and Automation Unzip Programs from the Support Info page of the /admin/ area of your Price Tapestry installation; (they should either be showing "Available" or "Unavailable") and if you could also confirm whether you have successfully used the Automation Tool with other feed URLs...?
Thanks!
David.
--
PriceTapestry.com
Hi David, thanks for the welcome.
I am relatively new to the software, and have only just installed this morning. Here is the status taken from the support info page;
Automation Handlers
php Available
curl Available
Automation Unzip Programs
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect.{code saved}
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect.{code saved}
unzip Not Available
gzip Not Available
Hi Marcus,
The above indicates that your hosting account is running in a relatively restricted environment - the Automation Handlers (php/curl) both use internal PHP functions; and are showing as available - so that's good; but the distribution version of the automation library relies on PHP being able to shell out to the unzip / gzip programs in order to decompress files where this is required.
However, I have a version of includes/automation.php that uses PHP's internal zlib functions to un-gzip files, and since CJ compressed feeds are .gz compressed this should do the trick for you, which I will email to you now... please check your email in a few minutes...
Cheers,
David.
--
PriceTapestry.com
Hey David,
I am also having trouble using the automation tool with CJ. The ftp url is correct. The error I was getting was Error - Transfer Failed. I then opened my config.advanced.php file and changed 'php' for 'curl' and am now getting Error - Unzip Failed. My Automation Handlers and Automation Unzip Programs both say "Avaliable":"Not Available".
Not sure if I need the includes/automation.php file you mentioned above, or if I should just switch to http feed.
Thanks,
Katelyn
Hi Katelyn,
For you and the benefit of others who may not have command line gzip available, here's the modification to includes/automation.php to use PHP's built-in gzip functions. First, open the file and add the following new code to the end of the script; just before the closing php tag:
function automation_unzip_phpgzip($tmp)
{
$gfp = gzopen($tmp,"r");
if (!$gfp) return FALSE;
$fp = fopen($tmp.".ungzipped","w");
if (!$fp) return FALSE;
while(!gzeof($gfp)) fwrite($fp,gzread($gfp,2048));
fclose($fp);
gzclose($gfp);
unlink($tmp);
rename($tmp.".ungzipped",$tmp);
return TRUE;
}With that in place and the modified file uploaded, edit config.advanced.php and look for the following setting at line 47:
$config_automationUnzipPrograms["gzip"] = "/bin/gzip";...and REPLACE with:
$config_automationUnzipPrograms["phpgzip"] = "";Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Thanks David,
Seems like that did the trick! Status says OK!
http://forum.liftersloot.com/
Hello Martin,
You should be able to use the Automation Tool - the easiest way to construct the required URL is to use FileZilla to connect to datatransfer.cj.com and navigate to the file you wish to transfer, and then in the remote window right-click on the filename and use the Copy URL(s) to Clipboard option which will create the required FTP URL minus your password, e.g.
ftp://userid@datatransfer.cj.com/outgoing/productcatalog/MerchantID/Merchant-Name.txt.gz...and finally for use within the Automation Tool as the download URL, insert your password as follows:
ftp://userid:password@datatransfer.cj.com/outgoing/productcatalog/MerchantID/Merchant-Name.txt.gzIf this is for a merchant that you already have registered and imported don't forget to use the existing filename as it is in your /feeds/ folder as Filename when setting up the job...
Hope this helps!
Cheers,
David.
--
PriceTapestry.com