Hello, I don’t understand how the shortcode or the URL works exactly. If the file is in a subdirectory, I don’t need to indicate the subdirectory ?
Download file url in access-s2member subdirectory
You can use subdirectores in the s2member-files folder, e.g. access-s2member-ccap-music/file.mp3
. See: WP admin > s2Member > Download Options > Custom Capabilities & Member Level Files
Sorry, I was not precise enough. The files are in ccap subdirectories. When I don’t understand how to generate a shortcode pointing to these files in these subdirectories.
I see. Did you try something like this?
[s2File download="access-s2member-ccap-music/file.mp3" /]
Thanks, it echoes the URL of the file. But I cannot find how to use it to make a download link.
<a href="[s2File download="access-s2member-ccap-revenu/obsidian-keep-couv.zip" /]">test</a>
gives a 404 error when I click on “test”. I suppose that the / may be a problem.
Could you show me the HTML you get?
If you just try the URL to it in your browser, without the shortcode, can you get the file? https://yoursite.com/?s2member_file_download=access-s2member-ccap-revenu/obsidian-keep-couv.zip
If the address is correct, then it may be a permissions problem, some security setting in your server or a plugin… https://s2member.com/kb-article/mod-security-odd-403-503-500-errors/#toc-f41e7e50
Could you show me the HTML you get?
From source code - content is managed in Classic Editor
<p><a href="[[s2File download=](https://boulot.li-an.fr/orevenu/[s2File%20download=)"access-s2member-ccap-revenu/obsidian-keep-couv.zip" /]">test</a><br />
</p>
If you just try the URL to it in your browser, without the shortcode, can you get the file?
Yes, the URL generated by the shortcode works when directly opened.
https://boulot.li-an.fr/?s2member_file_inline=yes&s2member_file_download=/access-s2member-ccap-revenu/obsidian-keep-couv.zip
I deactivated my security plugin (NinjaFirewall) without difference.