feat: implement file renaming

This commit is contained in:
2024-09-17 12:34:35 +07:00
parent cd9a7503b5
commit f52e75db78
10 changed files with 461 additions and 189 deletions

View File

@ -93,7 +93,7 @@ func sendFileChunk(w http.ResponseWriter, saveFolder string, file *models.File,
endOffset := end % chunkSize
for i := startChunk; i <= endChunk; i++ {
chunkPath := filepath.Join(saveFolder, file.Name, fmt.Sprintf("chunk_%d", i))
chunkPath := filepath.Join(saveFolder, fmt.Sprintf("chunk_%d", i))
chunkFile, err := os.Open(chunkPath)
if err != nil {
http.Error(w, fmt.Sprintf("Error opening chunk: %v", err), http.StatusInternalServerError)