Skip to main content
leandrolinof
Gold ⭐️
September 27, 2022
Question

FetchFile x Windows

Good afternoon,

 

Is there a way to use the FetchFile 1.16.2 processor to access files from Windows when the Nifi application is on Linux?

16 replies

leandrolinof
Gold ⭐️
September 28, 2022

This is the flow I'm working on, I'm using the UpdateAttribute to enter the path of a Windows network directory to get the .PDF files, but it throws the error below.

 

I must be doing something wrong or missing some other processor.

 

leandrolinof_0-1664368482388.png

 

 

UpdateAttribute

leandrolinof_1-1664368518485.png

Translate
stanere
Gold ⭐️
September 28, 2022

Hi @leandrolinof

FetchFile gets the file from the host system, in your case try GetSmbFile or mount remote share into Linux first and then use FetchFile.

Translate
stanere
Gold ⭐️
September 29, 2022

1 - it accepts no incoming connections, so I'd rather rebuild process around it or used distributed cache services. Try something like this:

  • get file from smb
  • put file to distributed cache while keeping it's identifier in an attribute
  • generate email body with replacetext or w/e you use and put it into attribute
  • fetch file from distributed cache
    use putemail with Attach File - true and Flow file content as message - false, set Message as an attribute with a body.

2 - process deletes files when Keep Source File property set to "false" (default configuration), to move file combine GetSmbFile (Keep Source File to false) with PutSmbFile.

3 - yep, as mentioned in 1, it's input/flowfile-generative processor, it should stay first in the stream.

Translate
SAMSAL
Platinum ⭐️⭐️⭐️
September 28, 2022

Hi,

I dont think it matters which system the path is located as long you have access to it. Do you have access to the path \\10.1.1.35\nifi from the machine where nifi is deployed? I'm not Linux expert but you need to test if the path with the file name is accessible by doing some system command or trying to access via file explorer.

 

Translate
leandrolinof
Gold ⭐️
September 28, 2022

@SAMSAL 

 

I can connect to the Windows directory both from another windows machine and from this linux machine that I'm using Nifi, but I'm not able to use the FetchFile processor, it throws the POST error.

Translate