mirror of
https://github.com/Forceu/Gokapi.git
synced 2026-05-05 05:50:51 -05:00
Fix bug where picture files where not uploaded at all when encryption and cloud storage was active as well as SaveToLocal #247
This commit is contained in:
@@ -194,7 +194,11 @@ func NewFileFromChunk(chunkId string, fileHeader chunking.FileHeader, userId int
|
||||
fileToMove = tempFile
|
||||
}
|
||||
processingstatus.Set(chunkId, processingstatus.StatusUploading, models.File{}, nil)
|
||||
err = filesystem.ActiveStorageSystem.MoveToFilesystem(fileToMove, metaData)
|
||||
if metaData.IsLocalStorage() {
|
||||
err = filesystem.GetLocal().MoveToFilesystem(fileToMove, metaData)
|
||||
} else {
|
||||
err = filesystem.ActiveStorageSystem.MoveToFilesystem(fileToMove, metaData)
|
||||
}
|
||||
if err != nil {
|
||||
return models.File{}, err
|
||||
}
|
||||
|
||||
@@ -42,5 +42,11 @@ func SetLocal() {
|
||||
ActiveStorageSystem = dataFilesystem
|
||||
}
|
||||
|
||||
// GetLocal gets the local filesystem, regardless of what filesystem is used by default. This is required when encrypted
|
||||
// pictures are stored locally instead of the cloud to support hotlinking
|
||||
func GetLocal() interfaces.System {
|
||||
return dataFilesystem
|
||||
}
|
||||
|
||||
// isUnitTesting is only set to true when testing, to avoid login with aws
|
||||
var isUnitTesting = false
|
||||
|
||||
Reference in New Issue
Block a user