BLUE
PHP 7.4.33
Path:
/var/www/receipt-app-backend-bitkit.dk/httpdocs/node_modules/formidable/src
Run
Logout
Edit File
Size: 1.94 KB
Close
/var/www/receipt-app-backend-bitkit.dk/httpdocs/node_modules/formidable/src/PersistentFile.js
Text
Base64
/* eslint-disable no-underscore-dangle */ import fs from 'node:fs'; import crypto from 'node:crypto'; import { EventEmitter } from 'node:events'; class PersistentFile extends EventEmitter { constructor({ filepath, newFilename, originalFilename, mimetype, hashAlgorithm }) { super(); this.lastModifiedDate = null; Object.assign(this, { filepath, newFilename, originalFilename, mimetype, hashAlgorithm }); this.size = 0; this._writeStream = null; if (typeof this.hashAlgorithm === 'string') { this.hash = crypto.createHash(this.hashAlgorithm); } else { this.hash = null; } } open() { this._writeStream = fs.createWriteStream(this.filepath); this._writeStream.on('error', (err) => { this.emit('error', err); }); } toJSON() { const json = { size: this.size, filepath: this.filepath, newFilename: this.newFilename, mimetype: this.mimetype, mtime: this.lastModifiedDate, length: this.length, originalFilename: this.originalFilename, }; if (this.hash && this.hash !== '') { json.hash = this.hash; } return json; } toString() { return `PersistentFile: ${this.newFilename}, Original: ${this.originalFilename}, Path: ${this.filepath}`; } write(buffer, cb) { if (this.hash) { this.hash.update(buffer); } if (this._writeStream.closed) { cb(); return; } this._writeStream.write(buffer, () => { this.lastModifiedDate = new Date(); this.size += buffer.length; this.emit('progress', this.size); cb(); }); } end(cb) { if (this.hash) { this.hash = this.hash.digest('hex'); } this._writeStream.end(() => { this.emit('end'); cb(); }); } destroy() { this._writeStream.destroy(); const filepath = this.filepath; setTimeout(function () { fs.unlink(filepath, () => {}); }, 1) } } export default PersistentFile;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 3 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
helpers
DIR
-
drwxr-xr-x
2026-05-06 08:23:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
parsers
DIR
-
drwxr-xr-x
2026-05-06 08:23:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
plugins
DIR
-
drwxr-xr-x
2026-05-06 08:23:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Formidable.js
17.60 KB
lrw-r--r--
2026-05-06 08:23:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FormidableError.js
1.21 KB
lrw-r--r--
2026-05-06 08:23:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
754 B
lrw-r--r--
2026-05-06 08:23:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PersistentFile.js
1.94 KB
lrw-r--r--
2026-05-06 08:23:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
VolatileFile.js
1.71 KB
lrw-r--r--
2026-05-06 08:23:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).