Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

Commit c9b1b75

Browse files
committed
Merge branch 'main' into go-doc
2 parents 5291e08 + ac24cc3 commit c9b1b75

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend/file.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ func (f FileStore) Save(filename, name string, file io.ReadSeeker, size int64) (
3535
ext := filepath.Ext(name)
3636

3737
if len(name) == 0 {
38-
// if no forced name is used, let's use the original name
38+
// if no forced name is used, let's use the original file name
3939
name = internal.CleanUpFileName(filename)
4040
}
4141

42+
// add random char to prevent duplicate key
43+
name += "_" + internal.RandStringRunes(16)
44+
4245
fileKey := fmt.Sprintf("%s/%s/%s%s",
4346
f.conf.Name,
4447
f.auth.AccountID,

0 commit comments

Comments
 (0)