diff --git a/s3/s3.go b/s3/s3.go index 109ef48b8a9a0485803148a843c8239b2805f178..dee365b31e3b0a092961352d5de6656c4cc82da1 100644 --- a/s3/s3.go +++ b/s3/s3.go @@ -167,6 +167,12 @@ func (s SessionWithHelpers) UploadWithSettingsRevised(data []byte, bucket string } } + if len(settings.FilePath) > 0 { + if settings.FilePath[len(settings.FilePath)-1] != '/' { + settings.FilePath = fmt.Sprintf("%s/", settings.FilePath) + } + } + fullFileName = fmt.Sprintf("%s%s%s%s", settings.FilePath, settings.FileName, uuidString, settings.FileExt) // Uploaded objects require a key