You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you able to confirm if generating links for assets without a public URL is supported?
I see a few mentions of it being supported in previous issues but it still doesn't seem to be the case. I can see the following code here that seems to confirm it not being supported:
It is a valid and common use case to have files that shouldn't have public URLs but still need to be served to a client. In my case I am using S3 file storage and need to protect downloads from unauthenticated users, leeching/hotlinking, search engine indexing etc.
I haven't done enough investigation to fully test a fix, and there might be much better ways to handle this, but could we use Craft's native "getCopyOfFile()" method to download a copy of this file to a temp directory before serving it to the client, thus removing the need to have public URLs? I tested this and it seems to work.
I would say there's potential downsides to this solution:
You're essentially downloading files twice
Large files might be slow
Might impact disk space on high-traffic sites downloading into temp
The method mentioned assigns a unique filename every time so that's not ideal and might need a workaround
Probably many more I haven't thought of
Maybe you or someone else has a way better idea for handling this use case?
Other plugins (like LinkVault) seem to handle it in this way but unfortunately it has been abandoned so I'm trying to get this plugin to work for my specific needs.
Craft: 4.8.9
DigitalDownload: 2.3.0
The text was updated successfully, but these errors were encountered:
CustomCodeIT
changed the title
Allow links without public URL on filesystem
Allow links without public URLs
Apr 11, 2024
Thanks for inquiring! The short answer is "no", Digital Download does not currently support cloud assets without a public URL. It is a technical limitation of how the downloads work, unfortunately.
However, I hadn't seen the getCopyOfFile solution in Link Vault. That seems like a clever workaround, even if it comes with some drawbacks. Craft has evolved a lot over the years, it's possible that there are some modern solutions to these older problems.
Thanks for the tip. I'll take a deeper dive into our options, and let you know what I find. 👍
Hi there,
Are you able to confirm if generating links for assets without a public URL is supported?
I see a few mentions of it being supported in previous issues but it still doesn't seem to be the case. I can see the following code here that seems to confirm it not being supported:
It is a valid and common use case to have files that shouldn't have public URLs but still need to be served to a client. In my case I am using S3 file storage and need to protect downloads from unauthenticated users, leeching/hotlinking, search engine indexing etc.
I haven't done enough investigation to fully test a fix, and there might be much better ways to handle this, but could we use Craft's native "getCopyOfFile()" method to download a copy of this file to a temp directory before serving it to the client, thus removing the need to have public URLs? I tested this and it seems to work.
I would say there's potential downsides to this solution:
Maybe you or someone else has a way better idea for handling this use case?
Other plugins (like LinkVault) seem to handle it in this way but unfortunately it has been abandoned so I'm trying to get this plugin to work for my specific needs.
Craft: 4.8.9
DigitalDownload: 2.3.0
The text was updated successfully, but these errors were encountered: