Article

Amazon S3 provider is appending the bucket name to the image URL if Cloudfront is used

« Go Back

Information

 
Article Number000094335
EnvironmentProduct: Sitefinity
Version: 5.x, 6.x, 7.x, 8.x, 9.x, 10.x, 11.x
OS: All supported OS versions
Database: All supported Microsoft SQL Server versions
Question/Problem Description
The image URL is generated with appending the BucketName in it, whereas the image URL of CloudFront CDN image does not contain the S3 Blob Storage Bucket Name. As a result, it generates a broken image/image link. 
Steps to Reproduce1. Configure CDN as shown here: https://docs.sitefinity.com/use-cdn-for-your-blob-storage-providers
2. Restart website
3. Upload an Image as part of a news item content
4. Set News widget on a page
5. Open details page of the news item

The result of this is that the image is not available and the URL of the image will be generated incorrectly.

Example:

http://Your-CloudFront-CDN-Domain/S3BucketName/images/default-source/library-name/image-name.jpg?sfvrsn=5c23c31d_1

instead of,

http://Your-CloudFront-CDN-Domain/images/default-source/library-name/image-name.jpg?sfvrsn=5c23c31d_1
Clarifying Information
Error Message"403 Forbidden" error on the browser console
Defect/Enhancement NumberBug 259610
Cause
For more information about Bug 259610, see https://feedback.progress.com/Project/153/feedback/Details/259610
Resolution
Until the fix is available, use the workaround below.
Workaround
1. Download AmazonBlobStorageProviderCustom.cs from the attachment section and place/include it into the root of the project and rebuild the project from the Visual Studio.

2. Use this into the ProviderTypeName field of the Blob storage provider advanced settings:

- Navigate to Administration » Settings » Advanced » Libraries » Blob storage » Blob storage providers » Your Amazon S3 Blob Storage Provider Name (e.g. S3 Bucket)

- Fill the following "ProviderTypeName" field with the value "SitefinityWebApp.AmazonBlobStorageProviderCustom, SitefinityWebApp":

ProviderTypeName: SitefinityWebApp.AmazonBlobStorageProviderCustom, SitefinityWebApp

- Save changes
Notes
Test the custom code attached in this article in a test environment first.

The amount of votes an item in the feedback portal has is taken into consideration when determining its priority. Vote for the item using the Like and Dislike buttons in the right-hand side menu to affect the priority it has. By casting a vote the voter will also be subscribed to a mailing list to receive notifications about changes of the item such as when it is fixed or implemented.
Last Modified Date2/11/2019 1:46 AM


Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025