add dir to different positions

This commit is contained in:
lublak 2021-02-15 13:25:30 +01:00
parent 8f318de288
commit cb9f31c49d
3 changed files with 6 additions and 3 deletions

View file

@ -157,6 +157,10 @@
<div class="label">File Name: </div>
<div class="value">{{binaryData.fileName}}</div>
</div>
<div v-if="binaryData.dir">
<div class="label">Directory: </div>
<div class="value">{{binaryData.dir}}</div>
</div>
<div v-if="binaryData.fileExtension">
<div class="label">File Extension:</div>
<div class="value">{{binaryData.fileExtension}}</div>

View file

@ -60,14 +60,12 @@ export class ReadBinaryFiles implements INodeType {
const items: INodeExecutionData[] = [];
let item: INodeExecutionData;
let data: Buffer;
let fileName: string;
for (const filePath of files) {
data = await fsReadFileAsync(filePath) as Buffer;
fileName = path.parse(filePath).base;
item = {
binary: {
[dataPropertyName]: await this.helpers.prepareBinaryData(data, fileName),
[dataPropertyName]: await this.helpers.prepareBinaryData(data, filePath),
},
json: {},
};

View file

@ -9,6 +9,7 @@ export interface IBinaryData {
data: string;
mimeType: string;
fileName?: string;
dir?: string;
fileExtension?: string;
}