Path problème qui empêchait la sauvegarde des fichiers dont la taille était inférieur au BUFFER (1024)
This commit is contained in:
parent
43844c9b54
commit
14f0c61c6e
@ -15,7 +15,12 @@ func ReceiveFile(path string, fileSize int, reader *bufio.Reader) bool {
|
||||
defer file.Close()
|
||||
|
||||
// Params
|
||||
buffer := make([]byte, 1024)
|
||||
var buffer []byte
|
||||
if fileSize < 1024 {
|
||||
buffer = make([]byte, fileSize)
|
||||
} else {
|
||||
buffer = make([]byte, 1024)
|
||||
}
|
||||
currentSize := 0
|
||||
|
||||
// Copy file
|
||||
|
Loading…
Reference in New Issue
Block a user