Zen Follower
- Join Date:
- Jun 2008
- Location:
- Japan
- Posts:
- 370
- Plugin Contributions:
- 6
Plugin download with curl
While testing on plugin manager, I was able to add a download function when new plugins version are available. It works fine as long as the zip file is on my server, it is downloaded and new version folder added to plugin folder. But when trying to download from Zencart server, curl returns the HTML code of a HTTP 404 error page...
The link I use for plugin files uses this format:
https://www.zen-cart.com/plugins/plugin-name-like-this/download
When using this link in my browser, the file download dialog box pops up and I can download the zip file. In a PHP script with curl, as sid above I got a 404 error (but no curl error).
I was wondering if some curl options are missing or if there is a protection on the sever to prevent scripts from downloading plugins?
The curl options I use are as folows:
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
Any info appreciated...
ZC v2.2.2 PHP 8.4+ MySQL 8.4+