File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
components/microsoft_outlook Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11import {
2- axios , getFileStream ,
2+ axios , getFileStreamAndMetadata ,
33} from "@pipedream/platform" ;
4- import path from "path" ;
5- import mime from "mime-types" ;
64const DEFAULT_LIMIT = 50 ;
75
86export default {
@@ -297,15 +295,17 @@ export default {
297295
298296 const attachments = [ ] ;
299297 for ( let i = 0 ; self . files && i < self . files . length ; i ++ ) {
300- const stream = await getFileStream ( self . files [ i ] ) ;
298+ const {
299+ stream, metadata,
300+ } = await getFileStreamAndMetadata ( self . files [ i ] ) ;
301301 const base64 = await this . streamToBase64 ( stream ) ;
302302 attachments . push ( {
303303 "@odata.type" : "#microsoft.graph.fileAttachment" ,
304- "name" : path . basename ( self . files [ i ] ) ,
305- "contentType" : mime . lookup ( self . files [ i ] ) ,
304+ "name" : metadata . name ,
305+ "contentType" : metadata . contentType ,
306306 "contentBytes" : base64 ,
307307 } ) ;
308- }
308+ } console . log ( attachments ) ;
309309 const message = {
310310 subject : self . subject ,
311311 attachments,
You can’t perform that action at this time.
0 commit comments