File upload thumbnails not displaying in AdminUI
See original GitHub issueBug report
Describe the bug
When uploading a file with the File field (I’m using the LocalFileAdapter), the thumbnail will show up in the Create dialog, but not when viewing the entry in the list (see below). I have both src
and path
properties of the file adapter set to the same place:
const fileAdapter = new LocalFileAdapter({
src: './files',
path: './files',
});
keystone.createList('FileTest', {
fields: {
name: { type: Text },
file: { type: File, adapter: fileAdapter },
}
});
A look in Chrome seems to indicate it’s trying to fetch the files from localhost:3000/admin/files
instead of localhost:3000/files
(where they actually are). Not sure how to fix this one.
Screenshots
System information
- OS: Windows 10 1903
- Browser: Chrome 78
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (10 by maintainers)
Top Results From Across the Web
opencast - .. - admin-ui - thumbnails.md - ZIVGitLab
An Uploaded Thumbnail is uploaded by the user. As both the video editor and your workflows need to work together to enable full...
Read more >WP Native Thumbnail not showing with the Image Shortcode ...
The issue is that if I upload hundreds of images at once, I have to manually go in and edit each one by...
Read more >How to display KeystoneJS thumbnail/preview images stored ...
File and Types.Url to return the image tag as a thumbnail/preview, but no luck with both of them, I noticed that format was...
Read more >Display an image in the admin grid in magento 2
I'm using the new grid system, the one with ui components. I took a look at how the thumbnail is added in the...
Read more >[Solved ]Problems with Video preview in admin UI - Installation
When I upload a mp4 file and try to preview it in the admin UI it does not load. Do I need a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey guys,
I’ve been setting up a Keystone + React project and bumped into the same issue. Found a solution that works with my setup.
Make sure that the StaticApp src starts the same as the FileAdapter src (in my case …/my-app)
Folders:
my-app
server
index.js
product.js
And then finally the resulting frontend code
PS: make sure to build your client first, otherwise your uploaded images will be overwritten by the new react app production code
Hope this helps anybody!
You also need the
@keystonejs/app-static
or express.static path configured