Support Questions

Find answers, ask questions, and share your expertise
Welcome to the upgraded Community! Read this blog to see What’s New!

Uploading a single file using File Upload UI to NiFi

New Contributor


I am trying to upload a file from UI and the content is received in NiFi but I am not able to maintain the filename. I am getting the filename as some integer which is by convention of the Flow file message attribute is correct. But Is there a way where I can maintain the file name, same as the file I have uploaded from UI.


S A Hameedh


Super Guru

How are you uploading the file? Processors like GetFile will set the filename attribute to the same name that was on disk.

New Contributor

Hi Matt,

I am using postman and in the body I am uploading a file.


S A Hameedh


@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

Content-Disposition: form-data; name="fileupload"; filename="file1.txt"
Content-Type: text/plain

this is file 1


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