keystonejs/keystone-classic

keystonejs 4 beta file system storage adapter image preview

Open

#3.781 geöffnet am 11. Dez. 2016

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.288 Forks)batch import
discussionhelp wanted

Repository-Metriken

Stars
 (14.656 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide