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
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
c8d3e42139
Коммит
8387d92ea2
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user