mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 22:20:55 +03:00
refactored upload away from multipart forms to binary data
This commit is contained in:
@@ -26,9 +26,8 @@ class FSStorage {
|
||||
const filepath = path.join(this.dir, id);
|
||||
const fstream = fs.createWriteStream(filepath);
|
||||
file.pipe(fstream);
|
||||
file.on('limit', () => {
|
||||
file.unpipe(fstream);
|
||||
fstream.destroy(new Error('limit'));
|
||||
file.on('error', err => {
|
||||
fstream.destroy(err);
|
||||
});
|
||||
fstream.on('error', err => {
|
||||
fs.unlinkSync(filepath);
|
||||
|
||||
Reference in New Issue
Block a user