diff options
| author | otofune <otofune@gmail.com> | 2017-11-14 04:39:21 +0900 |
|---|---|---|
| committer | otofune <otofune@gmail.com> | 2017-11-14 04:39:21 +0900 |
| commit | 519bb82b039dd037667f106b29f74bc0dffb4b3a (patch) | |
| tree | 8700567ff4caba49e68234cec6f156336b41d7a9 /src/api/common | |
| parent | create - バッファを使用しないように (diff) | |
| download | sharkey-519bb82b039dd037667f106b29f74bc0dffb4b3a.tar.gz sharkey-519bb82b039dd037667f106b29f74bc0dffb4b3a.tar.bz2 sharkey-519bb82b039dd037667f106b29f74bc0dffb4b3a.zip | |
add-file-to-drive - バッファ受け付けを削除
Diffstat (limited to 'src/api/common')
| -rw-r--r-- | src/api/common/add-file-to-drive.ts | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/api/common/add-file-to-drive.ts b/src/api/common/add-file-to-drive.ts index 1c8965e31d..e5d9dd7c1d 100644 --- a/src/api/common/add-file-to-drive.ts +++ b/src/api/common/add-file-to-drive.ts @@ -36,7 +36,7 @@ const addToGridFS = (name: string, readable: stream.Readable, type: string, meta * Add file to drive * * @param user User who wish to add file - * @param file File path, binary, or readableStream + * @param file File path or readableStream * @param comment Comment * @param type File type * @param folderId Folder ID @@ -45,7 +45,7 @@ const addToGridFS = (name: string, readable: stream.Readable, type: string, meta */ export default ( user: any, - file: string | Buffer | stream.Readable, + file: string | stream.Readable, name: string = null, comment: string = null, folderId: mongodb.ObjectID = null, @@ -59,17 +59,6 @@ export default ( res(file); return; } - if (file instanceof Buffer) { - tmpFile() - .then(path => { - fs.writeFile(path, file, (err) => { - if (err) rej(err); - res(path); - }); - }) - .catch(rej); - return; - } if (typeof file === 'object' && typeof file.read === 'function') { tmpFile() .then(path => { |