parent
a39f68b4e3
commit
8fa8526698
@ -29,7 +29,7 @@ const whitelist = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
class Uploader {
|
class Uploader {
|
||||||
constructor(client, socket) {
|
constructor(socket) {
|
||||||
const uploader = new SocketIOFileUploadServer();
|
const uploader = new SocketIOFileUploadServer();
|
||||||
const folder = path.join(Helper.getFileUploadPath(), ".tmp");
|
const folder = path.join(Helper.getFileUploadPath(), ".tmp");
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ class Uploader {
|
|||||||
const randomFileName = randomName;
|
const randomFileName = randomName;
|
||||||
const slug = data.file.base;
|
const slug = data.file.base;
|
||||||
const url = `uploads/${randomFileName}/${slug}`;
|
const url = `uploads/${randomFileName}/${slug}`;
|
||||||
client.emit("upload:success", url);
|
socket.emit("upload:success", url);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ function initializeClient(socket, client, token, lastMessage) {
|
|||||||
client.clientAttach(socket.id, token);
|
client.clientAttach(socket.id, token);
|
||||||
|
|
||||||
if (Helper.config.fileUpload.enable) {
|
if (Helper.config.fileUpload.enable) {
|
||||||
new Uploader(client, socket);
|
new Uploader(socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
socket.on("disconnect", function() {
|
socket.on("disconnect", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user