pda_private_link producing wrong URL for Amazon S3 use with PDA Gold?
-
I have a site that has been using Prevent Direct Access Gold for some time without issue.
However, recently, it’s been producing a “NoSuchKey” error with Amazon S3, with the description “The specified key does not exist.”
The file is getting uploaded to the S3 container, however it appears that the issue is with the URL being generated by PDAG’s “pda_private_link” shortcode. The S3 container’s URL/key for the file is:
_pda/wp-content/uploads/2025/01/[FILE.EXE]However the pda_private_link shortcode produces a URL of:
https://[AMAZON S3 DOMAIN]/_pda/www.[ORIGINALDOMAIN].com/wp-content/uploads/2025/01/[FILE.EXE]
In short, the ‘www.ORIGINALDOMAIN.com’ should not be part of the URL.
In the media library in WordPress, it shows the correct URL:
https://[AMAZON S3 DOMAIN]/_pda/wp-content/uploads/2025/01/[FILE.EXE]Here’s what the shortcode call in the PHP looks like:
$current_release_file = get_sub_field(‘release_file’); // ACF subfield that is a reference to the file
[pda_private_link file_id=” . $current_release_file[‘id’] . ” download_limit=2 download_expiry=3660]
- You must be logged in to reply to this topic.