Member since
10-09-2017
4
Posts
0
Kudos Received
0
Solutions
10-10-2017
05:39 PM
2 Kudos
@Hameed Abdul This is the expected behavior. Your file name is local to your client environment and NiFi have no clue on where it comes from. You need to send this information together with your file. The number that you are seeing is the ID that NiFi generated for this received flow file. How to send data depends on your client. If I use CURL to upload data I can do curl --form "fileupload=@/tmp/file1.txt;filename=file1.txt" localhost:7878
and I receive the following in NiFi --------------------------2c1843649b5760e1
Content-Disposition: form-data; name="fileupload"; filename="file1.txt"
Content-Type: text/plain
this is file 1
--------------------------2c1843649b5760e1--
You can use ExtractGrok or ExtractText to get the filename and update the flow file attribute. EDIT: As I said, this depends on your client. I did the same test with Postman and here's how to get the right information. Add a header to your POST query. I added a header called originalfilename I get this information as an attribute of my flow file With this you only need to use UpdateAttribute processor to copy this attribute to filename. Hope this helps
... View more