Remove sftp uploading

This commit is contained in:
Jonathan Cremin 2016-08-07 11:34:45 +01:00
parent 695644c260
commit f6ba817a26
4 changed files with 2 additions and 17 deletions

View file

@ -9,7 +9,6 @@ import hostrId from './hostr-id';
import resize from './resize';
import malware from './malware';
import { sniff } from './type';
import { upload as sftpUpload } from './sftp';
import debugname from 'debug';
const debug = debugname('hostr-api:uploader');
@ -96,10 +95,6 @@ export default class Uploader {
this.upload.resume();
}
sendToSFTP() {
return sftpUpload(join(storePath, this.path), join('hostr', 'uploads', this.path));
}
acceptedEvent() {
const acceptedEvent = `{"type": "file-accepted", "data":
{"id": "${this.id}", "guid": "${this.tempGuid}", "href": "${baseURL}/${this.id}"}}`;
@ -190,10 +185,7 @@ export default class Uploader {
const path = join(this.id[0], String(newSize.width), `${this.id}_${this.filename}`);
debug('Writing file');
debug(join(storePath, path));
return fs.writeFile(join(storePath, path), image).then(() => {
debug('Uploading file');
return sftpUpload(join(storePath, path), join('hostr', 'uploads', path));
}).catch(debug);
return fs.writeFile(join(storePath, path), image).catch(debug);
}).catch(debug);
}