Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin seems to be ignoring subfolders within S3 #7

Closed
chadcrowell opened this issue Oct 5, 2020 · 2 comments
Closed

Plugin seems to be ignoring subfolders within S3 #7

chadcrowell opened this issue Oct 5, 2020 · 2 comments

Comments

@chadcrowell
Copy link

Within my S3 web-assets bucket, I have a generic images folder, and then within there, a bunch of subfolders for different types of images accessed by the site: screenshot

Within the images folder is a products subfolder, and within there is a subfolder for each product, named for the product's part number. Within there is the original image and a bunch of transformed images and folders created by Craft screenshot

My volume settings for this S3 bucket look like this screenshot - so, all assets fields that use this volume begin their URLs with bucket-name/images

From there, in the assets field definition, the volume is specified, along with a further subfolder of products/{slug} as shown here screenshot - this is how we get to the full path as shown in the 2nd link above, and as demonstrated by the asset URL below, created by Craft:
https://assets.domain.com/images/products/vhm-series-laptop-tray-1/vhm36cablemanagement8inergotraylaptopunloaded.jpg

This is the asset URL I want your plugin to download from S3. But, the URL to the image that the plugin is providing is:
https://assets.domain.com/images/vhm36cablemanagement8inergotraylaptopunloaded.jpg?response-content-disposition=attachment%3B+filename%3Dvhm36cablemanagement8inergotraylaptopunloaded.jpg&AWSAccessKeyId=AKIAW4LLNYQ4B43UFGEM&Signature=Zizg7ADsLlX2TL%2F1w1js6KX22ZQ%3D&Expires=1602027127

Removing the querystring, here is that URL:
https://assets.domain.com/images/vhm36cablemanagement8inergotraylaptopunloaded.jpg

It appears the plugin is not injecting the extra URL segments that are defined in the assets field settings (again, shown here ).

Am I missing a setting, or does the plugin not account for custom URLs in the asset field settings?

@kennethormandy
Copy link
Owner

Thanks for the detailed summary! I’m pretty sure this was fixed in #3, and I’ve been meaning to get this beta version published to the plugin store.

You can give it a try now with:

composer require kennethormandy/craft-s3securedownloads:3.0.0-beta.1

If that solves the issue for you, I can get that published properly.

@chadcrowell
Copy link
Author

Yes, that worked, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants