keystonejs/keystone-classic

keystonejs 4 beta file system storage adapter image preview

Open

#3781 aperta il 11 dic 2016

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)JavaScript (2288 fork)batch import
discussionhelp wanted

Metriche repository

Star
 (14.656 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I want preview the upload file that is image

Gallery.add({
	name: { type: String, required: true },
	publishedDate: { type: Date, default: Date.now },
	image: { 
		type: Types.File, 
		storage: storage,
		format: function(item, file){
			return '<pre>'+JSON.stringify(file, false, 2)+'</pre>'+
				'<img src="'+file.url+'" style="max-width: 300px">'
		}
	},
});

I think i can not use the format function , because it is old function for ver 3 how can i do it

Guida contributor