Support » Plugin: WooCommerce » Digital products attachments still publicly visible

  • Resolved vato



    I’m creating some digital products that are downloadable. The files are uploaded to the Media library however they can be accessed by anyone that knows the link. It’s pretty easy to find those items by using the REST API GET /wp-json/wp/v2/media/ so how can I restrict these items from access by customers that haven’t payed for the digital products?

    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support EtienneP a11n


    Hi Vato!

    I tested this quickly on my test site and if choose X-Accel-Redirect/X-Sendfile as the download method for files, the URL for the file in the media library is available if I use GET /wp-json/wp/v2/media/, but I am unable to access that file when I try to visit the direct link due to a .htaccess restriction

    Could you double check which method you are using for file downloads?

    Thread Starter vato


    Hi Etienne,

    I checked my settings and the download method was set to “Force download”. I changed it as you suggested to X-Accel-Redirect, however the problem persists.

    • /wp-content/uploads/woocommerce_uploads/.htaccess
      deny from all

      I shouldn’t be able to access according to access configuration?

      I’m checking with my host provider for the configuration and will get back as soon as I have more information.


    • This reply was modified 4 years, 1 month ago by vato.
    Plugin Support EtienneP a11n


    Hi @vatanbytyqi

    I checked my .htaccess file and it also only has the deny from all rule so it should work on your site as well.

    Did you manage to find anything out from your host?

    Thread Starter vato


    Problem solved. My files were cached somewhere and any .htaccess change didn’t affect until the cache was cleared.

    Thank you for your help @etiennep

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Digital products attachments still publicly visible’ is closed to new replies.