@teamkeel/functions-runtime 0.395.2 → 0.395.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/File.js +9 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamkeel/functions-runtime",
3
- "version": "0.395.2",
3
+ "version": "0.395.4",
4
4
  "description": "Internal package used by @teamkeel/sdk",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/File.js CHANGED
@@ -167,10 +167,13 @@ class File extends InlineFile {
167
167
 
168
168
  const command = new GetObjectCommand({
169
169
  Bucket: process.env.KEEL_FILES_BUCKET_NAME,
170
- Key: "files/" + this.key(),
170
+ Key: "files/" + this.key,
171
+ ResponseContentDisposition: `attachment; filename="${encodeURIComponent(
172
+ filename
173
+ )}"`,
171
174
  });
172
175
 
173
- const url = await getSignedUrl(s3Client, command, { expiresIn: 60 * 24 });
176
+ const url = await getSignedUrl(s3Client, command, { expiresIn: 60 * 60 });
174
177
 
175
178
  return new URL(url);
176
179
  } else {
@@ -187,7 +190,7 @@ class File extends InlineFile {
187
190
  key: this.key,
188
191
  filename: this.filename,
189
192
  contentType: this.contentType,
190
- size: this._size,
193
+ size: this.size,
191
194
  };
192
195
  }
193
196
 
@@ -213,6 +216,9 @@ async function storeFile(contents, key, filename, contentType, expires) {
213
216
  Key: "files/" + key,
214
217
  Body: contents,
215
218
  ContentType: contentType,
219
+ ContentDisposition: `attachment; filename="${encodeURIComponent(
220
+ filename
221
+ )}"`,
216
222
  Metadata: {
217
223
  filename: filename,
218
224
  },