Skip to content
Snippets Groups Projects
Commit 79d79880 authored by James Page's avatar James Page
Browse files

#29 Explicitly set trailing slash for FilePath in UploadWithSettingsRevised so...

#29 Explicitly set trailing slash for FilePath in UploadWithSettingsRevised so that folder path string constants don't need to change.
parent 374a4638
Branches
Tags
1 merge request!32Resolve "Extend new S3.UploadWithSettingsRevised to handle file path and file name separately"
...@@ -167,6 +167,12 @@ func (s SessionWithHelpers) UploadWithSettingsRevised(data []byte, bucket string ...@@ -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) fullFileName = fmt.Sprintf("%s%s%s%s", settings.FilePath, settings.FileName, uuidString, settings.FileExt)
// Uploaded objects require a key // Uploaded objects require a key
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment