When I don’t set an explicit prefix using S3.withPrefix (or start the prefix with a slash), a “invisible” no-name top-level folder is created in the bucket. I think the problem is in the uploadFileTask function, assembling the key:
This makes total sense – except it seems that somewhere along the way another slash gets prepended to the key. This means that with an empty prefix, the key gets set to "/filename" and later to "//filename", which S3 happily inflates into a no-name folder as can be seen in the S3 Management Console. (Same thing happens if there is a prefix, but starts with a slash.)
When I don’t set an explicit prefix using
S3.withPrefix
(or start the prefix with a slash), a “invisible” no-name top-level folder is created in the bucket. I think the problem is in theuploadFileTask
function, assembling the key:This makes total sense – except it seems that somewhere along the way another slash gets prepended to the key. This means that with an empty prefix, the key gets set to
"/filename"
and later to"//filename"
, which S3 happily inflates into a no-name folder as can be seen in the S3 Management Console. (Same thing happens if there is a prefix, but starts with a slash.)