MM-10381: Change the file downloading API to stream file (#9144)

* Change the file downloading to stream file

* Change file downloading to chunk only for preview

* Remove unnecessary else case
Этот коммит содержится в:
Hyeseong Kim
2018-07-25 03:23:54 +09:00
коммит произвёл Christopher Speller
родитель c8d3e42139
Коммит 8387d92ea2
2 изменённых файлов: 22 добавлений и 11 удалений

Просмотреть файл

@@ -70,6 +70,14 @@ func (a *App) ReadFile(path string) ([]byte, *model.AppError) {
return backend.ReadFile(path)
}
func (a *App) FileReader(path string) (io.Reader, *model.AppError) {
backend, err := a.FileBackend()
if err != nil {
return nil, err
}
return backend.Reader(path)
}
func (a *App) FileExists(path string) (bool, *model.AppError) {
backend, err := a.FileBackend()
if err != nil {