Approved Download Catalogis a feature that helps manage the directories allowed for storing downloadable product files.
This feature was introduced in WooCommerce 6.5, and this particular feature is especially useful if products are being sold or intended to be sold that can be downloaded, and especially if there are many people on the site who have the ability to create and update products. For example, there may only be a handful of administrators, but there are multiple store managers or product vendors creating products and adding files.
![图片[1]-WooCommerce批准的下载目录-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/05/2024052406302937.jpeg)
Where are downloadable files stored?
When installing WooCommerce, it tries to create a new directory calledwoocommerce_uploads
This directory is located in WordPress' own upload directory. That's why thewoocommerce_uploads
The folder is included in the approved product download directory and is checked as enabled and recognized as secure by default.
However, in many cases it is better to store files elsewhere, for example using a cloud storage solution for very large files. WooCommerce fully supports this, but it can present challenges:
- Company policy may dictate that files are only stored in approved locations where administrators have full read and write access. In other words, it may be unacceptable to allow employees to link to downloaded content stored in their personal cloud storage accounts.
- Linking to files accessed through domains you don't control also poses various types of security risks, so it's best to limit acceptable locations to a pre-approved list.
The approved Download Catalog feature is to help with these issues.
Approved download directory settings
WooCommerce provides a series of settings in theWooCommerce > Settings > Products > Approved Download Catalog.to help webmasters control the location used to store and provide product downloads.
![图片[2]-WooCommerce批准的下载目录-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/05/2024052407005928.png)
From this location, approved directories can be added, edited, or deleted, and the feature can be completely disabled or enabled (rules can also be disabled or enabled individually). Note that all approved directories (including file paths) are represented as URLs.
The following points need to be remembered about this:
- Programs or agreements are important. In other words.
http://example.com/
as opposed tohttps://example.com/
. Both can be added at the same time if desired. It is also possible to use the//example.com
shorthand, which acts as a "wildcard" notation to encompass the same URL'shttp
and version.https
- You can directly enter the path of the file, which will be automatically converted to a URL using the program after saving.
file://
For example, enter the path to a file named For example, enter the path to the file/directory/path/example/
will be saved asfile:///directory/path/example/
The - Each approved directory implicitly covers all possible subdirectories. For example, if
https://my.site/files/
added to the list of approved directories, then add the files located in thehttps://my.site/files/nested/sub-directories/
into the product is perfectly fine. - These settings only affect digital downloads. They usually have no effect on the WordPress media library or image processing.
It needs to be emphasized thatOnly the site administratorhave the right to modify this list (or, in a multi-site network environment, the network administrator), andonly in the case thatThere is a corresponding entry on this page, otherwise no one else can add downloadable files to the product.
- If one is a site administrator and is the only one managing the store, then there is no need to worry about all this. Whenever a downloadable file is added as a site administrator that is not covered by an existing rule, a new rule is automatically added.
- It can also be completelyDisable this featureThe
- If another site user (such as an editor or store manager) tries to provide a URL to an unapproved catalog, they will see the following error, which encourages them to contact the webmaster for further assistance:
Enabling and disabling rules
Setting near the top of the screen "Stop/start rule enforcement"button to toggle the enforcement of rules in cases where it is impractical to manage an approved catalog. For example, if the person who added all the images has the "Store Manager" role instead of the "Administrator" role.
- To enable all rules, administrators can click"Start Rule Enforcement" buttonSimilarly, you can click on the "Stop Enforcing the Rules"button to disable it.
- Administrators can also use the"Enable all"respond in singing"Disable all"button to enable and disable all rules respectively.
- It can also be edited by selecting some or all of the rules and using the batch editmenu to enable or disable rules in bulk.
- To enable individual rules, administrators can hover over a rule in the list and select from the quick links that appear"Enable/Disable", or click the URL of the rule, and then click "Enable/Disable" from the"Catalog of editorial approvals"screen to enable/disable it.
![图片[3]-WooCommerce批准的下载目录-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/05/2024052407083610.png)
URLs in the Approved Download Catalog list accessible to non-paying customers
If unpaid customers can also access the download file, this means one of two things:
- The file was added to the media library through a method that is not part of the WooCommerce upload mechanism.The WordPress media library is inherently public, as it is the repository for all images attached to posts and pages. When creating a downloadable product, you should upload the file from the WooCommerce product rather than selecting an existing file from the media library.
- Using theRedirection only (not secure)File download method. Using this method means that your file will be unprotected and anyone with an upload link will be able to access the file, even if they are not logged in.
Other tools
In some cases, as a site administrator, additional control over this feature is required. For example, if product data is imported using a method other than the WooCommerce import tool, then WooCommerce may not initially notice the creation of a new download path. Therefore, it is possible to create a new download path in the WooCommerce > Status > Toolsscreen to find some additional tools:
- Synchronize approved download directories: This tool triggers a fresh scan of the product catalog. When downloadable product paths are found that are not covered by existing approved download catalog rules, these paths will be added to the list but initially disabled.
- Empty the list of approved download directories: Used to completely remove existing approved download directory listings.
![图片[4]-WooCommerce批准的下载目录-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/05/2024052407130492.png)
Disable downloading of files
Especially in more complex multi-user setups, it is entirely possible that a downloadable file may be added to a product and the corresponding rule in the approved download directory list may be disabled or deleted.
In this case, the affected downloadable file is also marked as disabled and displays a red asterisk to the right of the file URL field.
![图片[5]-WooCommerce批准的下载目录-光子波动网 | 专业WordPress修复服务,全球范围,快速响应](https://www.361sale.com/wp-content/uploads/2024/05/2024052407144347.png)
Link to this article:https://www.361sale.com/en/10471The article is copyrighted and must be reproduced with attribution.
No comments