jpayam Posted June 20, 2016 Share Posted June 20, 2016 Hi, After upgrading to last CC yesterday i receive below error message when see or edit any digitally product on my store. It has not been possible to locate the download file. http://product File location URL thanks Quote Link to comment Share on other sites More sharing options...
BooJewels Posted June 20, 2016 Share Posted June 20, 2016 I had a similar problem yesterday when checking on the one digital product I have (just building a new, upgraded store with CC6, from CC3), the file didn't seem to be there. What I did to associate the file with the product was > In the Downloads section in admin, click the fourth tab to 'update file list' and that popped the digital file into the list on the files tab. Then edit the product itself and on the 'Digital' tab, check the box for the file for that product. Quote Link to comment Share on other sites More sharing options...
jpayam Posted June 20, 2016 Author Share Posted June 20, 2016 I use external link (complete URL) for each product and i have 1000s of products! this is a bug? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 20, 2016 Share Posted June 20, 2016 As I understand it, there were edits in seo.class.php and gui.class.php in an attempt to stop non-seo formed urls from cropping up. Bsmither has already provided a fix for the sitemap timestamp issue this caused. I wonder if there is a digital product already created on the demo store, so this can be tested..... There is NOT a digital product already in the demo store, so we can't be sure at this point if this is a bug or not. I'm going to change the title of this thread to encourage some feedback from other digital sellers who have upgraded to 6.0.12. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 20, 2016 Share Posted June 20, 2016 The solution to Issue #1131 is incorrect insofar as not dealing with a complete URL as the (valid) value for the "Custom File Path" on the Digital tab of Add/Edit Product in admin. I will develop a better solution shortly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 21, 2016 Share Posted June 21, 2016 For CC6012, in the file /admin/sources/products.index.inc.php, near line 1204: Find: // Check digital download path exists if(!empty($result[0]['digital_path'])) { if(!file_exists($result[0]['digital_path'])) { $GLOBALS['main']->setACPWarning($GLOBALS['language']->filemanager['error_dl_3']." ".$result[0]['digital_path']); } } Replace that with: // Check digital download path exists if(!empty($result[0]['digital_path'])) { $no_exist_response = true; $no_curl_response = true; // Use curl_init() to check if valid URL if(filter_var($result[0]['digital_path'], FILTER_VALIDATE_URL) !== false){ $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, $result[0]['digital_path']); curl_setopt($curl_handle, CURLOPT_HEADER, false); curl_setopt($curl_handle, CURLOPT_NOBODY, true); curl_setopt($curl_handle, CURLOPT_TIMEOUT, 10); $curl_response = curl_exec($curl_handle); if (!curl_errno($curl_handle)) $curl_info = curl_getinfo($curl_handle); curl_close($curl_handle); $no_curl_response = (floatval($curl_info['http_code']) >= 400) ? true : false ; } else { $no_exist_response = !file_exists($result[0]['digital_path']); } if($no_exist_response &&$no_curl_response ) { $GLOBALS['main']->setACPWarning($GLOBALS['language']->filemanager['error_dl_3']." ".$result[0]['digital_path']); } } The PHP documentation seems to suggest that file_exists() will get a valid response from a remote URL, that is, true if the file exists at that URL. My experiments show otherwise. So, if the 'digital path' looks like a web address, we use CURL to have CubeCart make a request to the remote server. We do not actually want to fetch the file, so part of this curl() preparation is to specify simply sending a HEAD request -- which means to send back response headers, but no actual content. If the response headers have an 'http_code' of 400 or higher (such as 404 Not Found), there will be a problem getting this file anyway. Quote Link to comment Share on other sites More sharing options...
jpayam Posted June 23, 2016 Author Share Posted June 23, 2016 thanks, By this change problem has been fixed Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 23, 2016 Share Posted June 23, 2016 I don't recognize a GitHub request that references this issue - @bsmither ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.