keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.65k stars 2.21k forks source link

Download uploaded files from admin UI #4917

Closed vladislav-vasilyev closed 5 years ago

vladislav-vasilyev commented 5 years ago

Hi everybody. How can I download uploaded files from keystone admin UI? I see the only filename with extension string in the list item field but I couldn't download it (this field has the File type). Is it possible to add button/clickable link to download it?

autoboxer commented 5 years ago

The file name should be a link to the file. Clicking on it will either open it or download it depending on the file type and your browser settings. If that doesn't work, you may want to hover over the file name to see if the link is pointing to the correct location where your file is stored.

vladislav-vasilyev commented 5 years ago

@autoboxer How can I do it? Now I have this configuration for the file field: var Types = keystone.Field.Types;

var storage = new keystone.Storage({ adapter: keystone.Storage.Adapters.FS, fs: { path: 'uploads', }, });

Enquiry.add({ ... attachedFile: { type: Types.File, storage: storage, initial: true, }, ... }); ...

abhijithvijayan commented 5 years ago

@vladislav-vasilyev use cloudinary service for photo uploading

vladislav-vasilyev commented 5 years ago

@abhijithvijayan But what if I need to upload .doc, .docx, .pdf, .ppt, .pptx files?

abhijithvijayan commented 5 years ago

@vladislav-vasilyev Take a look at this issue

https://github.com/keystonejs/keystone/issues/4070

vladislav-vasilyev commented 5 years ago

I updated keystone to 4.0.0 version from 4.0.0-beta.5 and now it works as expected

NeoTheSecond commented 4 years ago
Screen Shot 2019-09-19 at 11 21 37 AM

I'm on keystone 4.2.1 and i still have this problem, i cannot download the file from admin ui

matiaskochlowski commented 4 years ago
Screen Shot 2019-09-19 at 11 21 37 AM

I'm on keystone 4.2.1 and i still have this problem, i cannot download the file from admin ui

HI @NeoTheSecond - did you manage to solve this? Also needing to allow admins to download files.