mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
fix error handling of s3.bucket param request also in upload method
This commit is contained in:
parent
941687692e
commit
481c7c6284
1 changed files with 3 additions and 4 deletions
|
@ -99,10 +99,9 @@ func (f *File) Register(fileHeader *multipart.FileHeader, scenarioID uint) error
|
|||
defer fileContent.Close()
|
||||
|
||||
bucket, err := configuration.GlobalConfig.String("s3.bucket")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if bucket == "" {
|
||||
if err != nil || bucket == "" {
|
||||
// s3 object storage not used, s3.bucket param is empty
|
||||
// save file to postgres DB
|
||||
f.FileData, err = ioutil.ReadAll(fileContent)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Reference in a new issue