chashikajw
chashikajw

Reputation: 828

Reading inside value of file object javascript

I have a Js file object like below in the image. What I need to do is read the name of the file. This file comes from dropzone( uploading task). Is anyone can help me.

enter image description here

I tried it in the following ways in the code.

onDrop = (acceptedFile) => {
        
        console.log("check file", acceptedFile);  // this is the object in above image

        
}

Is anyone can help me ? This is a react application.

Edit: this was caused a debugging issue with the cache. SInce I closed the question. this is working as expected. console.log(acceptedFile[0].name);

Upvotes: 2

Views: 830

Answers (1)

Fady Bark
Fady Bark

Reputation: 105

Have you tried console.log(accpetedFile[0]['name']);

Upvotes: 1

Related Questions