Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hi,

I would like to create a page in my site which will serve as a small document library. These documents require some password protection, and a single user/password will suffice. So for this I was thinking to use an htaccess security. There are other documents on the site which need to be available to non logged in users. So what I want to do is to be able to place file uploads on the Document Library page to a different upload folder (which will then have the htaccess password).

I see that this is controlled by the config statement: define( 'K_UPLOAD_DIR', 'myuploads' );

Is there a way to set this on my page (rather than sitewide in the congfig file)?

Other suggestions welcome if this is not possible! The document library page & the files all need password protection.

Thank you
Hi,
Have you considered using the 'Cloaked links' feature of Couch for the secured downloads? -
https://docs.couchcms.com/concepts/cloaked-links.html

Even if you opt for htaccess security instead, the uploads folder used by Couch (the one you mentioned being set through config), has a 'file/secure/' subfolder which is secured through such a .htaccess file (this folder is used for cloaked links). I think you can use this folder for your purpose.

Hope the reply helps.
Hi, thank you for your reply. I had a look and the cloaking feature looks good for what I need. Just one question - how do I ensure that files for the document library page will be uploaded into the 'secure' file folder? I'm hoping that can be done via Couch, or do I need to FTP them separately? Thanks for the help.
It can be done using Couch's file manager as the 'secure' folder is accessible through it. You'll need to instruct the client explicitly to place the file within this folder, though.
Ok that should be fine, thank you for your help :)
5 posts Page 1 of 1
cron