Deal with S3 “folder” and “file” properly