@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.
- package/package.json +1 -1
- package/src/File.js +9 -3
package/package.json
CHANGED
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 *
|
|
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.
|
|
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
|
},
|