mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-07 22:50:53 +03:00
changed from using input fields for keys to getting from url
This commit is contained in:
4
app.js
4
app.js
@@ -38,7 +38,7 @@ app.get('/assets/download/:id', function(req, res) {
|
||||
|
||||
});
|
||||
|
||||
app.route('/upload')
|
||||
app.route('/upload/:id')
|
||||
.post(function (req, res, next) {
|
||||
|
||||
var fstream;
|
||||
@@ -50,7 +50,7 @@ app.route('/upload')
|
||||
fstream = fs.createWriteStream(__dirname + '/static/' + filename);
|
||||
file.pipe(fstream);
|
||||
fstream.on('close', function () {
|
||||
let id = Math.floor(Math.random()*10000).toString();
|
||||
let id = req.params.id;
|
||||
client.hset(id, "filename", filename, redis.print);
|
||||
client.hset(id, "expiration", 0, redis.print);
|
||||
console.log("Upload Finished of " + filename);
|
||||
|
||||
Reference in New Issue
Block a user