Skip to content

Commit 7f2bceb

Browse files
committed
fix: alttext_ai, box
1 parent 1b5c444 commit 7f2bceb

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

components/alttext_ai/actions/generate-alt-text/generate-alt-text.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default {
7272

7373
let rawData = imageData;
7474
if (!rawData) {
75-
const stream = await getFileStream(this.imageInput);
75+
const stream = await getFileStream(imageFilePath);
7676
const chunks = [];
7777
for await (const chunk of stream) {
7878
chunks.push(chunk);

components/box/common/common-file-upload.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export async function getFileUploadBody({
2727
const data = new FormData();
2828
data.append("attributes", JSON.stringify(attributes));
2929
data.append("file", fileContent, {
30+
contentType: fileMeta.contentType,
3031
knownLength: fileMeta.size,
32+
filename: attributes.name,
3133
});
3234

3335
return data;

components/box/common/utils.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import path from "path";
21
import constants from "./constants.mjs";
32
import { getFileStreamAndMetadata } from "@pipedream/platform";
43

@@ -15,12 +14,13 @@ export default {
1514
.split(".")[0] + "Z",
1615
content_modified_at: new Date(metadata.lastModified).toISOString()
1716
.split(".")[0] + "Z",
18-
name: path.basename(filePath),
17+
name: metadata.name,
1918
parent: {
2019
id: 0,
2120
},
2221
},
2322
size: metadata.size,
23+
contentType: metadata.contentType,
2424
},
2525
};
2626
},

0 commit comments

Comments
 (0)