Closed matthijs166 closed 1 year ago
The preview also doesn't work when you upload an image that is smaller than the smallest image sizing. For example when I have a logo called example.png that is 250x250 and my smallest image sizing is 300x300. When I click on the upload link it correctly sends me to the url https://s3.url/media/logo.png
but the preview, left of the link, shows the image not being loaded. When I investigate the url it is a relative url for example: /media/logo.png
. And because the disablePayloadAccessControl
for this upload collection is set to true this relative url doesn't resolve.
Hey @matthijs166 — I am afraid I can't reproduce this. I just tested with a variety of SVGs and they all work properly. Can you create a minimally reproducible example? What version of Payload are you on?
@RickGeersing I also can't reproduce your issue either, but that is a separate issue so it should be opened separately. Let's keep this issue thread focused on the original SVG issue. One question for you though - you should check to see if you have an endpoint
defined in your S3 adapter config. If you don't, I could see how the URL might be relative. We use the S3 endpoint to generate URLs. If it's not that, and your issue persists, please open up another issue.
Thank you!!
This has been reported before and it ends up being improper mime-type on the SVG file. If files other than SVG are able to preview then it likely isn't this package. You could test different files and different storage options to isolate where the problem is.
If a file doesn't work just with the built-in local storage without this plugin, then we know the issue is that file.
I'm going to close this one. Feel free to re-open if you have a more information or new steps to try.
We are currently using the Payload CMS and have the 'plugin-cloud-storage' plugin installed, which connects to our S3 bucket. However, we've noticed that when we upload an SVG file, the thumbnail preview is not displayed in the CMS.
Upon further investigation, we found that the URL for the SVG file is not coming from the CDN, but instead from Payload itself. This results in a 404. Wich is wired because the JPG and PNG files have the correct url.
We got 'disablePayloadAccessControl' set to true to serve images directly from the CDN.
We would appreciate your assistance in resolving this issue as soon as possible, as it is affecting our ability to efficiently manage and preview our SVG files in the CMS.