feat: adds download file

This commit is contained in:
Rohan Verma
2020-01-03 16:32:19 +05:30
parent 6f4b748717
commit 089155520f
3 changed files with 177 additions and 32 deletions
+8
View File
@@ -47,6 +47,14 @@ err := s3.FileDelete(simples3.DeleteInput{
ObjectKey: "test.txt",
})
// You can also download the file.
file, _ := s3.FileDownload(simples3.DownloadInput{
Bucket: os.Getenv("AWS_S3_BUCKET"),
ObjectKey: "test.txt",
})
data, _ := ioutil.ReadAll(file)
file.Close()
// You can also use this library to generate
// Presigned URLs that can for eg. be used to
// GET/PUT files on S3 through the browser.