keystonejs/keystone-classic

mime type error on file upload with FS adapter (when only specifying path)

Open

#4.017 geöffnet am 19. Feb. 2017

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (1 zugewiesene Person)JavaScript (2.288 Forks)batch import
bughelp wanted

Repository-Metriken

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

Beschreibung

Steps to reproduce the behavior

  1. have a model with a field of type File and the file system adapter
  2. try to upload a file by calling model._.yourFileField.upload({path: specifiy your path})

Expected behavior

the file appears in the directory specified in the file system adapter

Actual behavior

an error occurs: mime is not a function

it happens because in lib/storage/index.js line 120 the mime type is tried to be evaluated when it wasn't specified in the file parameter, but the call has to be mime.lookup(file.path)

Contributor Guide