Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Support putting a publicly readable file to S3 bucket #166

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/flydrive-s3/src/AmazonWebServicesS3Storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ export class AmazonWebServicesS3Storage extends Storage {
* Creates a new file.
* This method will create missing directories on the fly.
*/
public async put(location: string, content: Buffer | NodeJS.ReadableStream | string): Promise<Response> {
const params = { Key: location, Body: content, Bucket: this.$bucket };
public async put(location: string, content: Buffer | NodeJS.ReadableStream | string, makePublic: boolean = false): Promise<Response> {
const params = { Key: location, Body: content, Bucket: this.$bucket, ACL: makePublic ? 'public-read' : 'private' };
try {
const result = await this.$driver.upload(params).promise();
return { raw: result };
Expand Down