pharoeste
pharoeste

Reputation: 69

How should I get the file path of an uploaded file in ant-d?

everyone!

I'm using ant-d upload component (https://ant.design/components/upload/) in a React application.

I want to get the file path, something like: C://Documents/file.txt (because I'm saving the form using FormData, so I should send the file path of the file).

Anyone knows if this is possible at all? As far I can see this is not possible right now.

Upvotes: 2

Views: 4515

Answers (1)

Jesper We
Jesper We

Reputation: 6087

Take a look at the customRequest property. In that function you are provided with an object with a filename property.

There is a bit mode docs at https://github.com/react-component/upload#customrequest ( uses this component underneath)

Upvotes: 2

Related Questions