File tree Expand file tree Collapse file tree 3 files changed +4
-15
lines changed
meistertask/actions/create-attachment
pdffiller/actions/upload-document
pixelbin/actions/upload-file Expand file tree Collapse file tree 3 files changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,6 @@ export default {
4949 optional : true ,
5050 } ,
5151 } ,
52- methods : {
53- checkTmp ( filename ) {
54- if ( filename . indexOf ( "/tmp" ) === - 1 ) {
55- return `/tmp/${ filename } ` ;
56- }
57- return filename ;
58- } ,
59- } ,
6052 async run ( { $ } ) {
6153 const {
6254 taskId,
@@ -65,11 +57,10 @@ export default {
6557 } = this ;
6658
6759 const data = new FormData ( ) ;
68- const path = this . checkTmp ( filepath ) ;
6960
7061 const {
7162 stream, metadata,
72- } = getFileStreamAndMetadata ( path ) ;
63+ } = getFileStreamAndMetadata ( filepath ) ;
7364 data . append ( "local" , stream , {
7465 contentType : metadata . contentType ,
7566 knownLength : metadata . size ,
@@ -83,6 +74,7 @@ export default {
8374 } ;
8475
8576 const response = await this . meistertask . createAttachment ( {
77+ $,
8678 taskId,
8779 data,
8880 headers,
Original file line number Diff line number Diff line change 11import FormData from "form-data" ;
22import { getFileStreamAndMetadata } from "@pipedream/platform" ;
3- import { checkTmp } from "../../common/utils.mjs" ;
43import pdffiller from "../../pdffiller.app.mjs" ;
54
65export default {
@@ -28,7 +27,7 @@ export default {
2827 async run ( { $ } ) {
2928 const {
3029 stream, metadata,
31- } = getFileStreamAndMetadata ( checkTmp ( this . file ) ) ;
30+ } = getFileStreamAndMetadata ( this . file ) ;
3231 const data = new FormData ( ) ;
3332 data . append ( "file" , stream , {
3433 contentType : metadata . contentType ,
Original file line number Diff line number Diff line change @@ -63,9 +63,6 @@ export default {
6363 uploadFile ( args = { } ) {
6464 return this . app . post ( {
6565 path : "/upload/direct" ,
66- headers : {
67- "Content-Type" : "multipart/form-data" ,
68- } ,
6966 ...args ,
7067 } ) ;
7168 } ,
@@ -106,6 +103,7 @@ export default {
106103 const response = await uploadFile ( {
107104 $,
108105 data,
106+ headers : data . getHeaders ( ) ,
109107 } ) ;
110108
111109 $ . export ( "$summary" , `Successfully uploaded file with ID \`${ response . _id } \`.` ) ;
You can’t perform that action at this time.
0 commit comments