keystonejs / keystone-classic

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

Keystone js File storage capabilities... #4963

Open Rajivkumar1234 opened 5 years ago

Rajivkumar1234 commented 5 years ago

How can we auto set an image using keystone 4? . For example if i have a model name Person and person has name , age , and profile pic . Now instead of manually uploading profile Pic . I have created a feature where data is being uploaded from csv , csv contains name , age and profile pic URL . Now I want to set that profile pic URL automatically is that possible in keystone 4? so that i no longer manually upload picture or set automati image from local file

What I did is an http request to the URL, download the file on your server and set it on your profile Model... but how can we set it through the model ?

aleygues commented 5 years ago

Hi, in your case, why do you not simply store the profile picture as an URL instead of downloading it and re-storing it? Moreover, your not responsible anymore for the good availability of the file!

jelordreygulle commented 5 years ago

Maybe because he needs a server copy of those files that in case that the source of the url no longer exist at least he would still have a copy.