Woocommerce Uploads, 403 Errors & Permissions

Woocommerce has a great system for creating virtual, ‘downloadable’ products. This is fantastic for when you offer some sort of digital product which the user can access after checkout. An example of this would be a training organisation, using downloadable products you can make the enrollment forms available for the user after paying for their course.

I won’t go over how to set this up, instead you can refer to this tutorial

When setting up the digital product you have the option to upload the product to the media library which will feel very familar for veteren wordpress users. However there is one thing to watch out for: Woocommerce will upload this file to the wp-content/uploads/woocommerce-uploads directory, which seems fine on the surface but you will quickly find that these files are not accessible directly (like putting a link to these files in your posts or pages).

After scratching my head for a while I checked the folder permissions, they seemed fine, checked the .htaccess file – nothing out of the ordinary there. Then I noticed a .htaccess file inside of the woocommerce-uploads file with the following content:

[dt_code]deny all[/dt_code]

Aha! This is what is causing my files to be inaccesible, now there is a quick and dirty fix, just change the contents of this file to:

[dt_code]allow all[/dt_code]

But I would recommend against this – as soon as Woocommerce updates that file will be rewritten and your links will break.

 

The bottom line

If you plan on reusing files uploaded to the woocommerce-uploads folder then just upload them via the regular wordpress media uploader.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top