Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
453 views
in Technique[技术] by (71.8m points)

pdf - Nifi Processor not preserving file extension

I have a Nifi flow where a document file eg/pdf, doc etc is sent from a REST API to a Nifi ListenHTTP processor. The processor is configured to accept all headers. Here is my problem

Steps to reproduce:

  1. hello-world.pdf sent to ListenHttp processor
  2. inspect the queue and download the file

expected result: The downloaded file should be named 'hello-world.pdf'

actual result: The downloaded file is named 'hello-world'

However, if I use a HandleHttpRequest processor followed by a HandleHttpResponse processor I get the expected result.

Does anybody know why the ListenHttp processor does not give me the expected result?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The solution is to add an 'update attribute' processor with an attribute

key mime.type value ${Content-Type}

This is because the HttpListener processor does not write this header by default.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...