mirror of
https://github.com/netfun2000/rttys_zhaojh329.git
synced 2026-02-27 09:53:24 +08:00
fix: frontend: file name have Chinese characters
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
@@ -114,10 +114,15 @@
|
||||
}
|
||||
|
||||
sendFileInfo(file: File) {
|
||||
const b = Buffer.alloc(4 + file.name.length);
|
||||
b.writeUInt32BE(file.size, 0);
|
||||
b.write(file.name, 4);
|
||||
this.sendFileData(MsgTypeFileInfo, b);
|
||||
const buf: Array<Buffer> = new Array<Buffer>();
|
||||
|
||||
const b = Buffer.alloc(4);
|
||||
b.writeUInt32BE(file.size)
|
||||
buf.push(b);
|
||||
|
||||
buf.push(Buffer.from(file.name));
|
||||
|
||||
this.sendFileData(MsgTypeFileInfo, Buffer.concat(buf));
|
||||
}
|
||||
|
||||
readFileBlob(fr: FileReader, file: File, offset: number, size: number) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user