keystonejs / keystone-classic

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

Multiple file upload in KeystoneJs 4.0 #3803

Open zhdan88vadim opened 7 years ago

zhdan88vadim commented 7 years ago

In version 0.4 there is LocalFiles field, which I think allows you to upload multiple files in a single database record. However in version 4.0 I haven't found a way to downloading multiple files in the album image gallery. I am trying to do so, and it turns out to download only one file.

I think such a function would be necessary. What do you think?

My code:

var myStorage = new keystone.Storage({
    adapter: keystone.Storage.Adapters.FS,
    fs: {
        path: keystone.expandPath('./public/uploads/gallery/img'), // required; path where the files should be stored
        publicPath: '/public/uploads/gallery/img' // path where files will be served
    }
});

var Gallery = new keystone.List('Gallery', {
    autokey: { from: 'name', path: 'key', unique: true },
    plural: 'Albums',
    singular: 'Album',
});

Gallery.add({
    name: { type: String, required: true },
    publishedDate: { type: Types.Date, default: Date.now },
    images: { type: Types.File, storage: myStorage },
});
juneil commented 7 years ago

+1 And there is also an issue with the render of the filename : <FileChangeMessage href={href} target="_blank">

It render a span and then the filename is not clickable...

neddyy commented 7 years ago

Has anyone got multiple local files working in 4.0.0beta? As far as I can see this is a regression from 0.4.x and 0.3.x?

neddyy commented 7 years ago

Right, this was being discussed last year in #3228

lukezona commented 6 years ago

Hi, are there any updates for multiple files uploads? From what I can see the File type still allows only one file, but maybe I'm missing something.

At the moment I'm still using LocalFiles though is deprecated, but is the only way I found to do it.

jacargentina commented 6 years ago

3228 was closed. So I hope this other issue gets some love.

We NEED to have MULTIPLE FILE UPLOAD!!! This is a BLOCKER for updating my website to 4.0; not having it is a REGRESSION.